Magento 2.3 - Customer Email Tempalte is sent emptymain.CRITICAL: Plugin class doesn't existMagento 2: How to override newsletter Subscriber modelWhy Getting categories and names on product view page Magento 2 fails?How to use Context object to get config valuesMagento offline custom Payment method with drop down listHow to solve Front controller reached 100 router match iterations in magento2Magento 2.3 Can't view module's front end page output?Magento 2 How to remove price filter from category if module is enable?Deleted ShipperHQ module causing error in “All Customers” section of Magento 2Magento 2.3.0 - The store that was requested wasn't found
Do I need a multiple entry visa for a trip UK -> Sweden -> UK?
Find swapfile location in Linux Mint
quarter to five p.m
Everything Bob says is false. How does he get people to trust him?
Was the picture area of a CRT a parallelogram (instead of a true rectangle)?
What will be the benefits of Brexit?
Tiptoe or tiphoof? Adjusting words to better fit fantasy races
Is there a problem with hiding "forgot password" until it's needed?
What defines a dissertation?
Will it be accepted, if there is no ''Main Character" stereotype?
voltage of sounds of mp3files
Star/Wye electrical connection math symbol
Using parameter substitution on a Bash array
Why is delta-v is the most useful quantity for planning space travel?
How can I use the arrow sign in my bash prompt?
Is it correct to write "is not focus on"?
Can I convert a rim brake wheel to a disc brake wheel?
What is the term when two people sing in harmony, but they aren't singing the same notes?
What's a natural way to say that someone works somewhere (for a job)?
Trouble understanding overseas colleagues
HashMap containsKey() returns false although hashCode() and equals() are true
Valid Badminton Score?
Where in the Bible does the greeting ("Dominus Vobiscum") used at Mass come from?
What is the oldest known work of fiction?
Magento 2.3 - Customer Email Tempalte is sent empty
main.CRITICAL: Plugin class doesn't existMagento 2: How to override newsletter Subscriber modelWhy Getting categories and names on product view page Magento 2 fails?How to use Context object to get config valuesMagento offline custom Payment method with drop down listHow to solve Front controller reached 100 router match iterations in magento2Magento 2.3 Can't view module's front end page output?Magento 2 How to remove price filter from category if module is enable?Deleted ShipperHQ module causing error in “All Customers” section of Magento 2Magento 2.3.0 - The store that was requested wasn't found
I have created a custom email template. I'm using transport builder to send the email, but for some strange reason the email is empty. To send email I'm using mageplaza-magento-2-smtp extension. Below my code:
etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<newsletter>
<referral>
<invite_friend_email_template>
newsletter_referral_invite_friend_email_template
</invite_friend_email_template>
</referral>
</newsletter>
</default>
</config>
etc/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="newsletter_referral_invite_friend_email_template"
label="Invite Friend Email"
file="invite_friend.html"
type="html"
module="Ped_Referral"
area="frontend"/>
</config>
view/frontend/email/invite_friend.html
<!--@subject trans "You have been invited to register" @-->
template config_path="design/email/header_template"
<p>
trans "You have been invited to register"
</p>
template config_path="design/email/footer_template"
Controller action to send email
<?php
declare(strict_types=1);
namespace PedReferralControllerCustomer;
use MagentoCustomerModelSession;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppArea;
use MagentoFrameworkAppConfigScopeConfigInterface;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionMailException;
use MagentoFrameworkTranslateInlineStateInterface;
use MagentoNewsletterModelQueueTransportBuilder;
use MagentoStoreModelScopeInterface;
use MagentoStoreModelStore;
use MagentoStoreModelStoreManagerInterface;
use PedReferralControllerCustomer;
use PsrLogLoggerInterface;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkControllerResultRedirect;
use MagentoFrameworkControllerResultInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
class Invite extends Customer
ResultInterface
*/
public function execute()
$resultRedirect = $this->resultRedirectFactory->create();
if (!$this->validateFormKey())
return $resultRedirect->setRefererUrl();
$email = $this->getRequest()->getParam('email');
try
$this->validateParams();
$this->inlineTranslation->suspend();
$this->sendMessage($email);
$this->inlineTranslation->resume();
$this->logger->info('Sent referral email message to ' . $email);
$this->messageManager->addSuccessMessage(__('Email sent successfully'));
catch (LocalizedException $e)
$this->messageManager->addErrorMessage($e->getMessage());
catch (Exception $e)
$this->logger->critical($e);
$this->messageManager->addErrorMessage(
__('An error occurred while processing your form. Please try again later.')
);
return $resultRedirect->setPath('referral/customer/index');
Why do I receive a blank email? (without subject neither body)
magento2 newsletter
add a comment |
I have created a custom email template. I'm using transport builder to send the email, but for some strange reason the email is empty. To send email I'm using mageplaza-magento-2-smtp extension. Below my code:
etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<newsletter>
<referral>
<invite_friend_email_template>
newsletter_referral_invite_friend_email_template
</invite_friend_email_template>
</referral>
</newsletter>
</default>
</config>
etc/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="newsletter_referral_invite_friend_email_template"
label="Invite Friend Email"
file="invite_friend.html"
type="html"
module="Ped_Referral"
area="frontend"/>
</config>
view/frontend/email/invite_friend.html
<!--@subject trans "You have been invited to register" @-->
template config_path="design/email/header_template"
<p>
trans "You have been invited to register"
</p>
template config_path="design/email/footer_template"
Controller action to send email
<?php
declare(strict_types=1);
namespace PedReferralControllerCustomer;
use MagentoCustomerModelSession;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppArea;
use MagentoFrameworkAppConfigScopeConfigInterface;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionMailException;
use MagentoFrameworkTranslateInlineStateInterface;
use MagentoNewsletterModelQueueTransportBuilder;
use MagentoStoreModelScopeInterface;
use MagentoStoreModelStore;
use MagentoStoreModelStoreManagerInterface;
use PedReferralControllerCustomer;
use PsrLogLoggerInterface;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkControllerResultRedirect;
use MagentoFrameworkControllerResultInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
class Invite extends Customer
ResultInterface
*/
public function execute()
$resultRedirect = $this->resultRedirectFactory->create();
if (!$this->validateFormKey())
return $resultRedirect->setRefererUrl();
$email = $this->getRequest()->getParam('email');
try
$this->validateParams();
$this->inlineTranslation->suspend();
$this->sendMessage($email);
$this->inlineTranslation->resume();
$this->logger->info('Sent referral email message to ' . $email);
$this->messageManager->addSuccessMessage(__('Email sent successfully'));
catch (LocalizedException $e)
$this->messageManager->addErrorMessage($e->getMessage());
catch (Exception $e)
$this->logger->critical($e);
$this->messageManager->addErrorMessage(
__('An error occurred while processing your form. Please try again later.')
);
return $resultRedirect->setPath('referral/customer/index');
Why do I receive a blank email? (without subject neither body)
magento2 newsletter
add a comment |
I have created a custom email template. I'm using transport builder to send the email, but for some strange reason the email is empty. To send email I'm using mageplaza-magento-2-smtp extension. Below my code:
etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<newsletter>
<referral>
<invite_friend_email_template>
newsletter_referral_invite_friend_email_template
</invite_friend_email_template>
</referral>
</newsletter>
</default>
</config>
etc/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="newsletter_referral_invite_friend_email_template"
label="Invite Friend Email"
file="invite_friend.html"
type="html"
module="Ped_Referral"
area="frontend"/>
</config>
view/frontend/email/invite_friend.html
<!--@subject trans "You have been invited to register" @-->
template config_path="design/email/header_template"
<p>
trans "You have been invited to register"
</p>
template config_path="design/email/footer_template"
Controller action to send email
<?php
declare(strict_types=1);
namespace PedReferralControllerCustomer;
use MagentoCustomerModelSession;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppArea;
use MagentoFrameworkAppConfigScopeConfigInterface;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionMailException;
use MagentoFrameworkTranslateInlineStateInterface;
use MagentoNewsletterModelQueueTransportBuilder;
use MagentoStoreModelScopeInterface;
use MagentoStoreModelStore;
use MagentoStoreModelStoreManagerInterface;
use PedReferralControllerCustomer;
use PsrLogLoggerInterface;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkControllerResultRedirect;
use MagentoFrameworkControllerResultInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
class Invite extends Customer
ResultInterface
*/
public function execute()
$resultRedirect = $this->resultRedirectFactory->create();
if (!$this->validateFormKey())
return $resultRedirect->setRefererUrl();
$email = $this->getRequest()->getParam('email');
try
$this->validateParams();
$this->inlineTranslation->suspend();
$this->sendMessage($email);
$this->inlineTranslation->resume();
$this->logger->info('Sent referral email message to ' . $email);
$this->messageManager->addSuccessMessage(__('Email sent successfully'));
catch (LocalizedException $e)
$this->messageManager->addErrorMessage($e->getMessage());
catch (Exception $e)
$this->logger->critical($e);
$this->messageManager->addErrorMessage(
__('An error occurred while processing your form. Please try again later.')
);
return $resultRedirect->setPath('referral/customer/index');
Why do I receive a blank email? (without subject neither body)
magento2 newsletter
I have created a custom email template. I'm using transport builder to send the email, but for some strange reason the email is empty. To send email I'm using mageplaza-magento-2-smtp extension. Below my code:
etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<newsletter>
<referral>
<invite_friend_email_template>
newsletter_referral_invite_friend_email_template
</invite_friend_email_template>
</referral>
</newsletter>
</default>
</config>
etc/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="newsletter_referral_invite_friend_email_template"
label="Invite Friend Email"
file="invite_friend.html"
type="html"
module="Ped_Referral"
area="frontend"/>
</config>
view/frontend/email/invite_friend.html
<!--@subject trans "You have been invited to register" @-->
template config_path="design/email/header_template"
<p>
trans "You have been invited to register"
</p>
template config_path="design/email/footer_template"
Controller action to send email
<?php
declare(strict_types=1);
namespace PedReferralControllerCustomer;
use MagentoCustomerModelSession;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppArea;
use MagentoFrameworkAppConfigScopeConfigInterface;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionMailException;
use MagentoFrameworkTranslateInlineStateInterface;
use MagentoNewsletterModelQueueTransportBuilder;
use MagentoStoreModelScopeInterface;
use MagentoStoreModelStore;
use MagentoStoreModelStoreManagerInterface;
use PedReferralControllerCustomer;
use PsrLogLoggerInterface;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkControllerResultRedirect;
use MagentoFrameworkControllerResultInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
class Invite extends Customer
ResultInterface
*/
public function execute()
$resultRedirect = $this->resultRedirectFactory->create();
if (!$this->validateFormKey())
return $resultRedirect->setRefererUrl();
$email = $this->getRequest()->getParam('email');
try
$this->validateParams();
$this->inlineTranslation->suspend();
$this->sendMessage($email);
$this->inlineTranslation->resume();
$this->logger->info('Sent referral email message to ' . $email);
$this->messageManager->addSuccessMessage(__('Email sent successfully'));
catch (LocalizedException $e)
$this->messageManager->addErrorMessage($e->getMessage());
catch (Exception $e)
$this->logger->critical($e);
$this->messageManager->addErrorMessage(
__('An error occurred while processing your form. Please try again later.')
);
return $resultRedirect->setPath('referral/customer/index');
Why do I receive a blank email? (without subject neither body)
magento2 newsletter
magento2 newsletter
asked 3 mins ago
Mirko RapisardaMirko Rapisarda
486
486
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267522%2fmagento-2-3-customer-email-tempalte-is-sent-empty%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267522%2fmagento-2-3-customer-email-tempalte-is-sent-empty%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown