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' => $...
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 ...
15
votes
Accepted
Magento order email sending to wrong customer..?
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 ...
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 ...
11
votes
Accepted
In Magento 1.9, why are order emails send through the queue, while Invoice emails are sent directly?
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 ...
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 ...
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/...
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/...
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\...
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>
&...
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\...
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 ...
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 ...
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();
//***...
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
{...
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: ...
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 ...
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-...
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 ...
5
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 ...
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->...
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\...
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 ...
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(
\...
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 ...
4
votes
Remove Subtotal, Shipping & Handling and Grand Total on order email?
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="...
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 ...
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\...
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 ...
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, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
order-email × 468magento2 × 188
magento-1.9 × 124
email × 100
email-templates × 85
sales-order × 49
orders × 32
transactional-mail × 30
cron × 20
magento-2.1 × 18
magento2.3 × 18
invoice × 17
magento2.2 × 14
order-confirmation × 14
order-status × 10
send-mail × 9
smtp × 8
php × 7
checkout × 7
magento-1.8 × 7
price × 7
magento-1.7 × 6
magento-2.2.5 × 6
pdf × 6
payment-methods × 5