In the database, in sales_order table, 'email_sent', usually = 1, is null.
Also the field 'send_email', usually = 1, is null.
Why this field is null?
May it be responsible for the 'non-sending' confirmation?
+1
Problem is still happening in Magento 2.1.7.
Field 'email_sent' is null.
Field 'send_email' Always = 1.
So it means that checkAndSend($order) return false in file 'MagentoSalesModelOrderEmailSenderOrderSender.php'
public function send(Order $order, $forceSyncMode = false)
{
$order->setSendEmail(true);
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
if ($this->checkAndSend($order)) {
$order->setEmailSent(true);
$this->orderResource->saveAttribute($order, ['send_email', 'email_sent']);
return true;
}
}
$this->orderResource->saveAttribute($order, 'send_email');
return false;
}
and that $this->identityContainer->isEnabled() return false in MagentoSalesModelOrderEmailSender.php
protected function checkAndSend(Order $order)
{
$this->identityContainer->setStore($order->getStore());
if (!$this->identityContainer->isEnabled()) {
return false;
}
$this->prepareTemplate($order);
/** @var SenderBuilder $sender */
$sender = $this->getSender();
try {
$sender->send();
$sender->sendCopyTo();
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
}
return true;
}
What is exactely $this->identityContainer->isEnabled() and how can iti be null 'sometimes'?
As a workaround I override Sender.php commenting this:
if (!$this->identityContainer->isEnabled()) {
return false;
}
in fact, in my configuration, email order confirmation has always to be sent; I cannot figure out in wich conditions (identityContainer->isEnabled()???) the email confirmation has not to be sent when an order is correctly placed.
Wainting for info from Magento people.
@PierAlex, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9
@PierAlex did you find a cause for the problem? I'm facing the same...
Your work around makes al mails sendig, i only want to send the order conformation
I'm facing the same issue on Magento EE 2.0.17
@Jilco, no sorry.
Still getting issue in Magento 2.1.10.
All other emails are reeving , but no order confirmation email.
Tried with Asynchronous true and false, but no luck :(
Got the same issue on v2.2.3.
But turned out it was not Magento issue, but payment gateway implementation.
Magento sends order confirmation email on sales_model_service_quote_submit_success event in Magento\Quote\Observer\Webapi\SubmitObserver but payment gateway implementation in my case redirected customer from checkout page through javascript and then directly to success page, so the event above was omitted.
In my totals there are half eurocents, eg. 12,955. The payment module (Mollie) didn't proces that kind of amount properly
Van: Radu CIOCOIU notifications@github.com
Verzonden: maandag 5 november 2018 10:48
Aan: magento/magento2
CC: Jilco; Mention
Onderwerp: Re: [magento/magento2] Sometimes, after an order is placed, 'The order confirmation email is not sent'. (#9737)
Hi @Gendos-uahttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FGendos-ua&data=02%7C01%7C%7C548e828eac12443e5ca608d64303e681%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636770081354932348&sdata=BuHJT7tr44Vp9eRDYJS2e611%2FGQrpu0T5eMZJa8aRvA%3D&reserved=0
What was the solution in your case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmagento%2Fmagento2%2Fissues%2F9737%23issuecomment-435814620&data=02%7C01%7C%7C548e828eac12443e5ca608d64303e681%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636770081354932348&sdata=sX60NgchGYg%2FcMwClXV2amcuo7yUDM5mjD%2FHU%2BY%2FM9k%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAWoMGjb1ctcQPoMBbylxd2wOk6_5HFT8ks5usAmGgaJpZM4NjeUp&data=02%7C01%7C%7C548e828eac12443e5ca608d64303e681%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636770081354932348&sdata=HCnFVq21LlWRQrTbQiHQN1347%2F9xUe5MpHglqVme7VI%3D&reserved=0.
[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virusvrij. www.avast.comhttps://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Getting same issue In Magento 2.2.5, Some orders email are not send automatically - I have to send it manually. what is the issue ?
We also have a client that has this issue. Most of the time the email does not send but it does send some of the time. Magento 2.2.7
The transportbuilderbystore class has already been deprecated in 2.3 and soon will be in 2.2.
This will also work in Magento 2.2.7
any solution? i have this issue in magento 2.3.1
We are using payu plugin in magento 2.3.3 the movement the it goes to the payment gateway page the order confirmation mail is sent out
We need to know how we can get this working to send mail only after payment confirmation
I se that the above solution working for lower version but not for 2.3.3 do you have any support on this ? http://www.tecsilk.com
I have smae issue sometimes. any fix
I have the same problem with Magento 2.3.5
@magento-engcom-team you should reopen it
Most helpful comment
Got the same issue on v2.2.3.
But turned out it was not Magento issue, but payment gateway implementation.
Magento sends order confirmation email on
sales_model_service_quote_submit_successevent inMagento\Quote\Observer\Webapi\SubmitObserverbut payment gateway implementation in my case redirected customer from checkout page through javascript and then directly to success page, so the event above was omitted.