17

(Update 2.3) use transportObject Use transportObject instead of transport $this->eventManager->dispatch( 'email_order_set_template_vars_before', ['sender' => $this, 'transport' => $transportObject, 'transportObject' => $transportObject] ); [Update] Add custom data in order email in Magento 2 At magento2 have an event which fire when ...


16

I finally found the solution to this problem in the Magento Community Forums, which was provided by @dunagan5887. I decided to share it here on magento.stackexchange.com as many may benefit from a well refered solution to this exception. There is a link to the original Community Forum post: Email template with block It seems that this solution, as quoted ...


15

First Step Edit the file: app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/email/order/items.phtml After this line: <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"> <?php echo $this->__('Sku') ?></th> Add this: <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php ...


15

This issue must be related to the new Magento Email Queue system, that leaves orphan records on the Recipients table. If this is your issue, I send you a fix. The new Magento Email Queue system manages these two tables: core_email_queue and core_email_queue_recipients. The former one handles the email Messages, and the later one, the Recipients of these ...


11

Orders email are sent using the queue for different reasons: Avoid frontend slowdown while sending out the email Resend on failure Avoid errors on checkout/post-checkout Solution 1 (send order's email immediately): If you like to send order email immediately you can consider overriding the Mage_Sales_Model_Order::queueNewOrderEmail() method by chainging ...


10

I was facing same issue but I found alternative solution like I turned off Magento default Order Confirmation email and Send Order Confirmation Email When Order is being placed Successfully. Here are the step to follow : Create Observer Event which being called after order placed : events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www....


8

The new 1.9.1 Email System leverages two database tables to queue, process, and log transactional order confirmation emails sent after customers checkout: core_email_queue This stores data relating the emails that are sent for order confirmations core_email_queue_recipients - This stores the email addresses of the recipients of the emails stored in ...


8

Completely safe - and in most cases mandatory, otherwise jobs can end up being skipped. Just make sure you are executing cron.sh not cron.php Just note that the regularity of the cron itself won't dictate when cron operations take place - the module itself does that. Eg. Using the awesome MageRun to list tasks, [www-data@acc1 .microcloud ~] [~]$ ...


7

Attention! What this code does is: every time the magento-cronjob removes all sent messages from the core_email_queue database table, it also removes all recipients of these messages. So, basically, it does not work for you until this cronjob-task has run at least once. Solution I found the answer thanks to another question here: the ...


7

As CLI in Magento doesn't have an appropriate area, I figured out the following workaround: app/code/NameSpace/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <!-- Add this for sending email via cli -...


7

On the Front page, the print order action will not generate the PDF like Admin does. It will generate the HTML. We should take a look the print layouts under vendor/magento/module-sales/view/frontend/layout. For example: vendor/magento/module-sales/view/frontend/layout/sales_order_print.xml vendor/magento/module-sales/view/frontend/layout/...


6

You can do it easily with disable the order confirmation email from admin and enable invoice email from admin. So it will send email at the time on invoice (payment received) only and not sent the order confirmation email. Order email setting, Set it to No : Admin -> Stores -> Configuration -> Sales -> Sales Email -> Order -> Enabled ...


6

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); $connection = $resource->getConnection(); //*****************loading Customer session *****************// $customerSession = $objectManager->create('Magento\Customer\Model\Session'); //******** Checking ...


5

Magento sales email order item are comming from app/design/frontend/YOURPACKAGE/YOUR_TEMPLATE/template/email/order/items.phtml OR app/design/frontend/base/default/template/email/order/items.phtml All sales email related templates file are located at app/design/frontend/YOURPACKAGE/YOUR_TEMPLATE/template/email/ OR app/design/frontend/base/default/...


5

Fixed and tested: add to your existing module or add a new module: config.xml // src/app/code/local/Your/Module/etc/config.xml <?xml version="1.0"?> <config> <modules> <Your_Module> <version>1.0.0</version> </Your_Module> </modules> <global> <models> ...


5

You need to send separate email to admin because BCC is buggy. Try below step : configuration->sales emais->order -> Send Order Email Copy Method = via seperate Mail You can also consider the below mentioned point: First of all, Magento 1.9+ relies completely on cron jobs to send transactional emails. If you didn’t have cron jobs set up properly before, ...


5

This may be a bug of Emogrifier module. Put this in the require-dev part of composer.json: "pelago/emogrifier": "1.0.0 as 0.1.1" Or prefer the development version: "pelago/emogrifier": "dev-master as 0.1.1" There is a notice: seem that this issue also occurs when processing static content deploy. UPDATE: We should take a look: vendor/magento/theme-...


5

There's a simple way you can do this. Creating a custom variable for the email can be too much time consuming, so the easiest way to get this result would be using a .phtml file on your transnational email. Add this to your email HTML: {{block type='core/template' area='frontend' template='email/custom/mynote.phtml' order=$order}} Create a file path/to/...


5

This can be achieved by rewriting Magento\Sales\Model\Order\Email\Sender\OrderSender::send function, For that first add the following in your di.xml <preference for="Magento\Sales\Model\Order\Email\Sender\OrderSender" type="Company\Module\Model\Order\Email\Sender\OrderSender"/> and Create class OrderSender with as below namespace Company\Module\...


5

Magento 2 allows sending a copy of orders to an email besides the customer's email. It can be done thru Stores -> Settings -> Configuration -> Send Order Email Copy To In the latest version of Magento, this setting is here Store >> Settings >> Configuration >> Sales >> Sales Email >> Send Order Email Copy To


5

As you specified in your question that you have disabled Order Confirmation email from backend, I have assumed the same and write code in such a way that email will not sent twice even if you have enabled Order Confirmation email from backend. So, Order Confirmation Email will only sent from success page when you have disabled it from backend. To send email ...


5

You can try the following code to add Custom data in the email template. app/code/Anshu/Emails/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Anshu_Emails', __DIR__ ); app/code/Anshu/Emails/etc/module.xml <?xml version="1.0"?> <config ...


5

Source: https://github.com/sashas777/bug-from-email Issue on Magento's GitHub Repo: https://github.com/magento/magento2/issues/14952 Please check following steps to resolve this issue. Create your custom module to rewrite core files In your /Vendor/Module/etc/di.xml add following code <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3....


5

Try repository for loading order. So your modified class looks like: <?php use \Magento\Sales\Model\Order\Email\Sender\OrderSender; use Magento\Sales\Api\OrderRepositoryInterface; class MyClass { private $orderSender; private $order; public function __construct( OrderSender $orderSender, OrderRepositoryInterface $...


4

TL;DR: use the "Bcc" option instead of the "Separate Email" option for order copy emails, because the latter is seriously broken in Magento 1.9.1. It will expose your copy email addresses to the customer. There is something fundamentally broken with how Magento is handling this. When you have multiple (comma-separated) email addresses specified in "Send ...


4

Need to comment code in layout file sales.xml (\app\design\frontend\YOUR_PACKAGE\YOUR_TEMPLATE\layout\sales.xml) <sales_email_order_items> <block type="sales/order_email_items" name="items" template="email/order/items.phtml"> <action method="addItemRender"><type>default</type><block>sales/...


4

There is no such e-mail that you are looking for. I just had a look at the e-mail templates folder to prove this (see app/locale/en_US/template/email) but neither did I hear or see about such a version of an order e-mail that is sent to an admin before nor did I find one in this folder.


4

Take a look to this https://github.com/magento/magento2/blob/135f967/app/code/Magento/Quote/Observer/Webapi/SubmitObserver.php#L40-L58 I think the right object is use Magento\Sales\Model\Order\Email\Sender\OrderSender; and use the method "send" In my case, checkAndSend was protected and I cannot use from external the class


4

Add on to Prashant Valanda's answer for your second question of logo. Navigate to System configuration -> Sales -> Sales -> Invoice and Packing Slip Design and upload the logo. Navigate to System configuration -> General -> Design -> Transactional Emails.


4

I give my answer about order email. Other emails and pdf should works with the same logic. You have to look at \vendor\magento\module-sales\view\frontend\layout\sales_email_order_items.xml where the block with class Magento\Sales\Block\Order\Email\Items has the template \vendor\magento\module-sales\view\frontend\templates\order\items.phtml In this ...


Only top voted, non community-wiki answers of a minimum length are eligible