1

I have created some custom transactional emails in the backend and would like to send them programmatically, perhaps with a simple custom form.

In Magento 1 it was possible to do this:

$localeCode = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getStoreId());
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('custom_text_template',$localeCode);
$emailTemplateVariables = array('custom_text' => ''.$customText.'','title_title' => ''.$titleTitle.'');
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
$emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name'));
$emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));
$emailTemplate->send($email, $name, $emailTemplateVariables);

In Magento 2 how can I do this?

Thanks for any help

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.