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













0















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)









share


























    0















    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)









    share
























      0












      0








      0








      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)









      share














      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





      share












      share










      share



      share










      asked 3 mins ago









      Mirko RapisardaMirko Rapisarda

      486




      486




















          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
          );



          );













          draft saved

          draft discarded


















          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















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

          Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»

          Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр