Skip to main content
28 votes
Accepted

Magento 2 : How to add custom data in order email

(Update 2.3) use transportObject Use transportObject instead of transport $this->eventManager->dispatch( 'email_order_set_template_vars_before', ['sender' => $this, 'transport' => $...
Amit Bera's user avatar
  • 77.7k
17 votes
Accepted

Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPath

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 ...
ElGatito's user avatar
  • 890
12 votes
Accepted

magento 2 order confirmation email sending before payment gatway redirection

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 ...
Ronak Chauhan's user avatar
10 votes

how to stop order confirmation email in magento 2.0

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 ...
Ashish Jagnani's user avatar
8 votes

Which file hold this layout {{layout handle="sales_email_order_items" order=$order area="frontend"}}

You can update in the file : vendor/magento/module-sales/view/frontend/templates/email/items.phtml Or override in your custom module : app\design\frontend\our-template\default\layout\sales.xml app\...
Magetop E-commerce's user avatar
7 votes

Magento 2: order email does not translate

When an email is sent via cron or from CLI - need to make sure that the Translate Area Part is loaded. For me the following piece of code has helped (I used it right before the email message template ...
Dmytro  Lukachuk's user avatar
7 votes

Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPath

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/...
rut4's user avatar
  • 111
7 votes
Accepted

Magento 2: How to change the content of print order

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/...
Khoa TruongDinh's user avatar
6 votes

magento 2 order confirmation email sending before payment gatway redirection

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\...
Arshad M's user avatar
  • 866
6 votes

Magento customer email missing in guest checkout, when using soap api

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> &...
cottton's user avatar
  • 235
6 votes

Magento 2: New order mail notification to admin

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 ...
AKKAweb's user avatar
  • 172
6 votes
Accepted

Magento 2 Order Confirmation Email Send Programatically from Success.php

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 ...
Hitarth Pattani's user avatar
6 votes
Accepted

Get all orders of customer by email id Magento 2

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); $connection = $resource->getConnection(); //***...
Muhammad Hasham's user avatar
6 votes
Accepted

Sending order confirmation email in magento 2 programmatically

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 {...
Sohel Rana's user avatar
  • 36.1k
6 votes
Accepted

Magento 2 : Fatal error, all to a member function getParentItem() on null

First, I have the exact same error, but I have this is two places - Customer account, view order->view invoice / -> view shipping (for that order) In both those, I get the error: Fatal error: ...
ProxiBlue's user avatar
  • 9,926
5 votes

Magento 2 Get shipping and billing address of customer after order placed?

You can add this piece of code in the file: <?php /** @var $_order \Magento\Sales\Model\Order */ ?> <?php $_order = $block->getOrder() ?> <?php $billingAddress = $_order->...
osrecio's user avatar
  • 1,628
5 votes
Accepted

Extending Order Email template in Magento 2

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\...
Anshu Mishra's user avatar
  • 9,010
5 votes
Accepted

Sales Emails going via wrong email address magento 2.2.x

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 ...
Aasim Goriya's user avatar
  • 5,454
5 votes
Accepted

I want to add delivery date in order email template in Magento-2.1?

For this you need to create a simple module say Mago_Delivery. Create following files app/code/Mago/Delivery/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \...
Pawan's user avatar
  • 5,991
5 votes
Accepted

Delivery date in order email template - Magento 2.4.3-p2

You should use the same logic described in comment https://magento.stackexchange.com/a/358427/91782 I don't recommend to rewrite models such Order just for get some value for email template. You need ...
Victor Tihonchuk's user avatar
4 votes
Accepted

Magento 2 How to set owner email address to get new order email?

To receive all new orders e-mail you have set-up some Configuration in Admin, more specifically (Store -> Configuration -> Sales -> Order -> Send Order Email Copy To), after you complete this field, ...
Catalin Ionita's user avatar
4 votes

Magento 2 : Add Custom Field To Order, Invoice, Shipment, Credit Memo

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 ...
LucScu's user avatar
  • 2,362
4 votes
Accepted

magento 1.9 order email total column move to right

app\design\frontend\base\default\layout\sales.xml <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action> Change to &...
Madhumitha's user avatar
4 votes
Accepted

How to add new column and custom attribute in order email template in Magento 1.9.3?

Consideration:code of custom attribute is custom Note: Please do not edit core files, Copy below files to your Theme First we need to add a column to template: file path:app\design\frontend\rwd\...
Pawan's user avatar
  • 5,991
4 votes
Accepted

Magento 2 Store email addresses not editable

So. If you come across this issue, its related to your env.php file. The config has been exported to the env and is overwriting the admin area meaning you can't edit it. trans_email' => [ ...
andy jones's user avatar
  • 1,383
4 votes
Accepted

Email notification for cancelled order

You can always write your own module that will do that. You will need few ingredients for that: Have an observer that listens on the sales_order_save_after event. This link explains it well catch ...
Marjan's user avatar
  • 1,149
4 votes
Accepted

How to get the product image in invoice email template?

My problem has been solved (thanks to xdebug :) by replacing $_item->getProduct() that I used in the order email template with $_item->getOrderItem()->getProduct() That's after noticing that ...
Hassan Al-Jeshi's user avatar
4 votes

Get all orders of customer by email id Magento 2

Try this, <?php namespace Vendor\Module\Controller\Orders; class ReadOrders extends \Magento\...
Prathap Gunasekaran's user avatar
4 votes
Accepted

Magento2 : Order Items Email Template Adjustment

Following steps will be useful step 1: override the items.phtml code Path:app/design/frontend/Theme/Magento_Sales/templates/email/items.phtml <?php /** * Copyright © Magento, Inc. All ...
Arunprabakaran M's user avatar
4 votes

Add product thumbnail in order email template

The accepted answer is a very hacky way to achieve what you want and I wouldn't recommend it. If you override the file vendor/magento/module-sales/view/frontend/templates/email/items/order/default....
Adam Mellen's user avatar

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