33 votes
Accepted

How to send an email programmatically in Magento 2?

/** * Recipient email config path */ const XML_PATH_EMAIL_RECIPIENT = 'contact/email/recipient_email'; /** * @var \Magento\Framework\Mail\Template\TransportBuilder */ protected $_transportBuilder; /**...
Anil Singh's user avatar
20 votes
Accepted

Magento2 cannot load some transaction emails

This is a bug in Magento 2 and here is the solution: https://github.com/magento/magento2/pull/5116/files This will fixed the invalid json objects in the order email templates. See this on vendor/...
nhinzky's user avatar
  • 709
10 votes
Accepted

Why does Magento 2 suspend inline translation while sending a transactional email?

Inline translation is disabled when sending an email because, when inline translation is active, any translatable printed text (__('Text here')) goes through Magento\Framework\Phrase\RendererMagento\...
Marius's user avatar
  • 198k
9 votes

Magento 2 - How to add custom block/template to transactional mail?

We can do like this: {{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Vendor_Module::email/custom.phtml'}} See more here: vendor/magento/module-sales/view/...
Khoa TruongDinh's user avatar
8 votes

How to add customers email to transactional emails content

I'll leave you here several variables in case you need them: - For registration: {{var customer}} Will print out all customer information {{var customer.ID}} {{var customer.email}} {{var customer....
alxh28's user avatar
  • 81
7 votes

Magento 1.9.2 not sending new order confirmation emails

The cronjob is working (otherwise you would not get this exception) and if your hoster said, that Magento did not try to send any emails, the exception has another reason. Unfortunately the message ...
Fabian Schmengler's user avatar
7 votes

Magento 2 how to add if or else statement to email template?

The conditonal syntax in email templates is the same as Magento 1. Thus in your email template you can do stuff like this for example: {{if logo_width}} width="{{var logo_width}}" {{else}} ...
Raphael at Digital Pianism's user avatar
6 votes
Accepted

Magento 2 : How to solve the special characters in email subject?

Using this reference on the Magento 2 Repository in Github, you can create a plugin to fix like that: di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Rafael Corrêa Gomes's user avatar
6 votes
Accepted

How to send different order emails to admin and customer in magento 2

You may try pre-made extensions like: https://www.hiddentechies.com/new-order-notification-magento-2.html (Free) https://codecanyon.net/item/magento-2-new-order-notification/19237122 (Paid) or you ...
Mohit Kumar Arora's user avatar
5 votes

Line break for invoice comment in magento

try this on transactional email invoice update {{var comment|nl2br}}
Christian Young's user avatar
5 votes

custom transactional email special characters issue

I managed to find a solution by using Zend Mail : $mail = new Zend_Mail('UTF-8'); $mail->setType(Zend_Mime::MULTIPART_RELATED); $mail->setBodyHtml($processedTemplate); $mail->setFrom($...
Alexglvr's user avatar
  • 1,675
4 votes

Create transactional email via install/upgrade script

To have a clear answer, here is the installation code I usually use to create a transactional email : <?php $installer = $this; $installer->startSetup(); $code = 'My Mail Title'; $subject = '...
hellimac's user avatar
  • 775
4 votes

Is there a way to add foreach loop in email template?

Actually you can use a for loop in emails. I've tested it on 2.3.3 version. This is the code location to inspect. This is how it looks like in the template: <ul> {{for item in data.items}} ...
augsteyer's user avatar
  • 271
4 votes

Transactional Emails multistore

If you want to keep the content and heading of your transactional e-mails flexible you should make use of the "insert variables" option when compiling your e-mail template. For instance: < td ...
Naomi Krosenbrink's user avatar
4 votes
Accepted

How to change logo alone in email templates

Go to Backend : System > Configuration > General > Design > Transactional Emails > Logo Image And easily pick your logo image from there. The image will be uploaded here /media/email/...
Ahmed Elawadi'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,846
4 votes
Accepted

How to send Transaction email from controller in Magento 2

it's working for me $emailTemplateVariables = array(); $emailTempVariables['myvar'] = $myvar; $senderName = 'test'; $senderEmail = '[email protected]'; $...
Rv Singh's user avatar
  • 1,617
3 votes

Static blocks in transactionals email for multilingual stores

What you can do is the following Copy your transactional mail templates for each store view and then add the specific block into each of them as follows: Create a new email template in System > ...
Klettseb's user avatar
  • 3,572
3 votes

Magento Different Transactional Emails Per Store View

The success email template is send by sendConfirmationSuccessEmail method in Mage_Newsletter_Model_Subscriber class: // A lot code ... const XML_PATH_SUCCESS_EMAIL_TEMPLATE = 'newsletter/...
Denis Spalenza's user avatar
3 votes

Magento Different Transactional Emails Per Store View

It should work as you described besides after all that you did you should flush the cache and then it should be fine. I´ve just tested it on my staging environment and it worked fine as per follows: ...
Klettseb's user avatar
  • 3,572
3 votes

Disable welcome email at first login

Copy: app/code/core/Mage/Customer/Model/Customer.php TO: app/code/local/Mage/Customer/Model/Customer.php In the function "sendNewAccountEmail" (around line 561), comment out the last 2 lines that ...
Sheikh Wasim's user avatar
3 votes

Line break for invoice comment in magento

It should simple work to add a HTML tag around the place you use the comments. For some of my stores I have it like that {{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$...
Klettseb's user avatar
  • 3,572
3 votes

Remove Subtotal, Shipping & Handling and Grand Total on order email?

Add the following to your theme's local.xml (if you don't know how to do that, please refer to "How to use local.xml / theme.xml" in this answer: <sales_email_order_items> <remove name="...
Fabian Schmengler's user avatar
3 votes
Accepted

Is there any way to run core_email_queue_clean_up without having to send all emails in the queue?

You could use magerun sys:cron:run to execute only one cronjob command. For more info click here
Mr. Lewis's user avatar
  • 1,921
3 votes

Magento 2: Update order emails

how to send update mail in magento public function __construct( .... \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Framework\ObjectManagerInterface $objectManager, .... ) { .... $...
Surendra Kumar Ahir's user avatar
3 votes
Accepted

How to add new Template Variable in magento

Template variables are comes from email template comments, To add new template variable we need to add it to email template comment section(at top of email template html) as like below: <!--@...
Ranjit Shinde's user avatar
3 votes

Why does Magento 2 suspend inline translation while sending a transactional email?

When in-line translation is allowed public function string will translated accordingly. So you need disable it and resume later. This also prevent issues with improperly enabled inline translation. ...
BartZalas's user avatar
  • 1,757
3 votes
Accepted

Magento 2 : Transaction mail Logo And Footer Default Links

please check the path vendor/magento/theme-frontend-luma/Magento_Email/email/foot‌​er.html vendor/magento/module-email/view/frontend/email/header.html
Nikhil waghela's user avatar
3 votes

Magento 2 - Html Tags in Comment Section of Transactional E-Mails

By default Magento does not allow html tags in the order comments. It's in the controller that handles the comments. Take a look in vendor/magento/module-sales/Controller/Adminhtml/Order/AddComment....
Sejal Shah's user avatar
  • 2,141
3 votes
Accepted

Magento 1.9 check if order got shipment

Try using below code to check if the order has shipped. <?php $hasShipment = $this->getOrder()->getShipmentsCollection()->count(); if($hasShipment){ .... // Do your stuff } ?>
Jaimin Sutariya's user avatar

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