New answers tagged

1

I had a misunderstanding in the structure of the data being passed to the email template. The "data" object was set as the only accessible DataObject in the variables array passed to send(...) in Mail.php. So I could access the data object like this in the email template: {{layout handle="email_product_custom_options" dataObj=$data area="frontend"}} ...and ...


1

The only new variable I see in your code is "isquotation". So I don't think it's neccesary to overwrite all other functions of the OrderSender class as well. I've recently had to check for a specific payment method as well and I only modified the prepareTemplate method. If I combine this with your code this would be: <?php namespace Ops\KgOrder\Model\...


1

Difficult to know without seeing your email send logic but typically you need to build objects which you then pass through to email templates. https://magento.stackexchange.com/a/283338/70343 So I would have thought you would be better passing the block template output as a variable.


0

Instead of adding condition directly in the email template, you can replace your "sentence" with a block: {{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Vendor_Module::email/order/info.phtml' order=$order}} Then in your template email/order/info.phtml, you can use the condition however you want: if ($this->...


1

I've completely migrated data from Magento 1 to Magento 2 (orders, products, customer, rules, coupons, newsletter subscribers etc) and yes email and newsletter templates can be migrated with the data migration tool.


1

You need to build objects which you then pass through to email templates. https://magento.stackexchange.com/a/283338/70343 If it's a custom template then it's going to be custom code passing the variables.


0

Another option would be to use the transactional email section of the admin to load the email template into the database. You can then do a database level store based translation. Even make content changes of you like.


0

you can try below way.. i have translated in German langugae "New %changes for %user_name","Nieuwe %changes voor %user_name"


0

You can the value of custom attribute in the order email using the following code: {{trans "%custom_attribute" custom_attribute=$order.getCustomAttribute()}}


1

Magento Allows you to pass Varien Objects to email templates. If you see into order email templates you will get to know how order data is fetched from order object. Try setting data $customerObject = new Varien_Object(); $customerObject->setData($appointmentCustomer); $emailVariables['customer']=$customerObject; And in email template fetch the data as ...


0

If it's a static string you can do this in your transactional email template https://docs.magento.com/m2/ce/user_guide/marketing/variables-custom.html


0

Fixed this issue by extending Magento\Framework\Mail\Message and adding new function createCustomAttachment in this, also edited the createHtmlMimeFromString function. protected $attachment; public function createCustomAttachment($body, $mimeType, $disposition, $encoding, $filename){ $attachment = new Part($body); $attachment->setType($mimeType)...


0

Steps to call PHTML file in custom email template: Write below code in email template to call custom phtml file. You can pass custom data in $custom_var to PHTML file. {{layout handle="custom_email_data" custom_var=$custom_var area="frontend"}} Create layout file at below path : Vendor/Module/view/frontend/layout/custom_email_data.xml <?xml version="...


0

We can use HTML Codes for Spanish Language Characters &uacute; to make it take ú in email template, Make sure the type is html type="html" in YourVendor/YourModule/etc/email_templates.xml Here are the different Spanish characters you may want to use: Display FriendlyCode NumericalCode Hex Codes Description Á &Aacute; &#...


0

You can use it like this in you email template file <a href={{var yourUrl}} target="__blank"> Test </a> Hope it Helps.


1

You can use magepal free extension for email sending , using gmail you can easily configure this mageplaza extension link


1

You must setup a mail server on your localhost unless you can use modules SMTP to sendmail.


1

You can create a template file in your theme this core file : vendor/magento/module-sales/view/frontend/templates/email/shipment/track.phtml and add condition before this function getTracksCollection you can add condition like this <?php if ($_shipment && $_order): ?> So that issue will fixed for magento 2.3.1


0

It is working for me. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $alltemplele = $objectManager->get('\Magento\Email\Model\ResourceModel\Template\Collection'); $alltemplele = $alltemplele->toOptionArray(); print_r($alltemplele_data);


0

try with below code for get email templates : $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $alltemplele = $objectManager->get('\Magento\Email\Model\ResourceModel\Template\Collection'); $alltemplele_data = $alltemplele->toOptionArray();; print_r($alltemplele_data); i hope its work for you.


Top 50 recent answers are included