Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
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.5k
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
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
7 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
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: 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
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 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
  • 35.9k
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

Order emails only sent to customer not to admin

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 ...
Arunendra's user avatar
  • 7,448
5 votes

Order mail confirmation generates DOMXPath::query() error

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

Get my custom variable into an email template

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 ...
Arunendra's user avatar
  • 7,448
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
  • 8,970
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,444
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,901
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

Order emails only sent to customer not to admin

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 ...
Anna Völkl's user avatar
  • 17.3k
4 votes

Send Copy of Order Confirmation email programmatically in magento 2

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\...
José Antonio's user avatar
4 votes

How to Customized the new order template: Magento

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 ...
Ashish Madankar M2 Professiona'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,332
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,901

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