Hot answers tagged

5

You have to create email_templates.xml Customform\ReturnRequest\etc <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="hello_template" label="Hello World" file="hello.html" type="html" module="...


4

Create send.php file into root folder. require_once('app/Mage.php'); //Path to Magento umask(0); Mage::app(); $html=" Write your Content Here "; $mail = Mage::getModel('core/email'); $mail->setToName('Your Name'); $mail->setToEmail('YoueEmail@gmail.com'); $mail->setBody('...


3

Magento 2: The simplest way I found to send a plain text - use Zend1 mail $email = new \Zend_Mail(); $email->setSubject("Feedback email"); $email->setBodyText($body); $email->setFrom($from, $nameFrom); $email->addTo($to, $nameTo); $email->send();


2

You can add this script to your custom .php file and you can run it in browser. require_once('app/Mage.php'); //Path to Magento umask(0); Mage::app(); $msg = "your message"; mail("someone@example.com","My subject",$msg);


2

Took me a little while to track functionality down https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php#L117 Which traces through to this https://github.com/magento/magento2/blob/80469a61e061abd0001c93497a6d92296b46496b/app/code/Magento/User/Model/Notificator.php#L94 /** * Send a ...


2

In magento direct email not sending to the admin. Magento show low stock report at Reports > Product > Low stock For Magento 2.2.x Admin Low Stock Notification email Free extension available in github https://github.com/bharat2762/magento2-admin-low-stock-notification For Magento 2.3.x Admin Low Stock Notification email Free extension available in github ...


2

You can send mail using Zend_Mail() function. $firstname = "xxx"; $lastname = "yyyyyy"; // Send Mail functionality starts from here $from = "from_address@example.com"; $nameFrom = "From Name"; $to = "to_address@example.com"; $nameTo = "To Name"; $body = " <div> <b>".$firstname."</b> <i>".$lastname."</i> </div>"; ...


2

Ensure that you are using the right area code email_templates.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="..." label="This is email template" file="general_template.html" type="html" module=...


1

I figured it out. When adding a shipment through the Admin page, there is an "Email Copy of Shipment" checkbox that must be checked to send the email. When using the API, the notify parameter must be included in the request and set to true.


1

create layout file view/frontend/layout/cform_index_index.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <referenceContainer name="content"> <block class="Trading\Cform\...


1

You can pass Url in setTemplateVars() like below, public function __construct( \Magento\Framework\Filesystem\DirectoryList $directory ){ $this->directory = $directory; } You can get Media Url from below code, $imageUrl = $this->directory->getPath('media'); Than after, you can pass in setTemplateVars() like shown below $templateVars = ...


1

You should use below code: <img src="{{media url=test/logo.svg}}" alt="" />


1

Try to use this below code in your helper: <?php namespace RH\MailSystem\Helper; class Data extends \Magento\Framework\App\Helper\AbstractHelper { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** * @var \Magento\Framework\Mail\Template\Factory */ protected $templateFactory; ...


1

The issue was a typo in email_templates.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="backinstock_email_template" label="Back In Stock" file="back_in_stock.html" type="html" module="Xigen_BackInStock" area="frontend"/> &...


1

You can try this way, Get Store id like this, add this class in your __construct() Magento\Store\Model\StoreManagerInterface 'store' => $this->storeManager->getStore()->getId()); $transport = $this->transportBuilder->setTemplateIdentifier( $this->scopeConfig->getValue( self::...


1

Change following code: 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID, DEFAULT_STORE_ID is 0 which is for admin. Assing valid store id instead of 0. Ex: 'store' => 1 OR Transfer your template to view/base/email folder.


1

You can managed to work it by following code: Step 1: Create a module with name Vendor_Module and do the following changes. Step 2: create di.xml under app/code/Vendor/Module/etc/di.xml with content: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...


1

you can use this event "email_invoice_set_template_vars_before" and you can also find more events here : https://www.magestore.com/magento-2-tutorial/use-event-magento-2


1

You can add it in configuration On the Admin Panel, Stores > Settings > Configuration. On the left panel, under Sales tab, click on Sales Emails subtab. Open the shipment section Add email or comma separated email in 'Send Shipment Email Copy To' If you want to customise this beyond configuration you are changing this: https://github.com/magento/magento2/...


1

this might be happening by any custom third-party extension or customization because this is not a default Magento functionality to attach pdf with email.


1

The default is for Magento to use the "Customer Support" email identity when sending the forgot password email. The sender name and email for that identity can be changed from the admin at the following location: Stores > Settings > Configuration > General > Store Email Addresses


1

For the cancel order use below event <event name="order_cancel_after"> <observer name="order_cancel_after" instance="Sm\BackEnd\Observer\NewEmail" /> </event> Also, change the event.xml file path. Move event.xml file from etc/frontend/events.xml to etc/events.xml


1

The extension code shown above works based on event/observer concept. Whenever a new order is placed the above code gets executed. You need to look at the file called events.xml in etc/events.xml. In the events.xml you may need to specify the additional event (in your case it is cancel/completed) and assign the observer. https://devdocs.magento.com/...


1

This extension works fine on Magento ver. 2.3.1, https://github.com/extait-com/email-attachment Just add a function in Extait/Attachment/Mail/Message.php, public function setFromAddress($fromAddress, $fromName = null) { $this->zendMessage->setFrom($fromAddress, $fromName); return $this; } and test it via command php bin/magento extait:test:...


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