Magento 2: Transportbuilder sending empty mailsMagento dont send transactional mailsMagento mails / cronMagento email_queue sending mails every 2 minutesE-mails won't send MagentoMagento 1.9.2.2 emails not sendingMagento dropshipper e-mailsEmpty email custom module Magento 2 transportBuildermagento 2 e mails not sending since httpsMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options

Validation accuracy vs Testing accuracy

XeLaTeX and pdfLaTeX ignore hyphenation

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

Why is this code 6.5x slower with optimizations enabled?

Is Social Media Science Fiction?

How is this relation reflexive?

Is it possible to do 50 km distance without any previous training?

Why is an old chain unsafe?

Can a German sentence have two subjects?

TGV timetables / schedules?

Do airline pilots ever risk not hearing communication directed to them specifically, from traffic controllers?

Why was the small council so happy for Tyrion to become the Master of Coin?

Why Is Death Allowed In the Matrix?

Could a US political party gain complete control over the government by removing checks & balances?

Is there a minimum number of transactions in a block?

Prevent a directory in /tmp from being deleted

Are tax years 2016 & 2017 back taxes deductible for tax year 2018?

Infinite past with a beginning?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

What is the offset in a seaplane's hull?

A Journey Through Space and Time

Copycat chess is back

Patience, young "Padovan"

What do you call a Matrix-like slowdown and camera movement effect?



Magento 2: Transportbuilder sending empty mails


Magento dont send transactional mailsMagento mails / cronMagento email_queue sending mails every 2 minutesE-mails won't send MagentoMagento 1.9.2.2 emails not sendingMagento dropshipper e-mailsEmpty email custom module Magento 2 transportBuildermagento 2 e mails not sending since httpsMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I'm trying to use the transportbuilder to send an custom email in my module.
I succeed in sending an email, but the body is always empty.



This is my email_templates.xml (placed in view/frontend/email/)



 <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
</config>


And this is my mail function:



 $emailTemplateVariables = array();
$emailTempVariables['ucdata'] = 'dummy';

$sendToEmail = 'email@gmail.com';

$postObject = new MagentoFrameworkDataObject();
$postObject->setData($emailTempVariables);

$sender = array('email' => "info@mywebsite.nl", 'name' => 'Mywebsite');

$transport = $this->_transportBuilder->setTemplateIdentifier('empty_email_template')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom($sender)
->addTo($sendToEmail)
->setReplyTo($sender['email'])
->getTransport();
$bla = $transport->sendMessage();


And this is my template:



 <strong>De volgende producten zijn verwijderd door Lightmakers:</strong> <br><br>
<pre>
trans "Ucdata: %ucData" ucData=$data.ucdata
</pre>


The email is fully blank (no static template content aswell), but I don't get any error messages while sending.
Is there a way to debug this situation?










share|improve this question














bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • did you debug this?

    – CompactCode
    Dec 2 '17 at 18:46











  • Did you find the answer? Same issue here.

    – Coen Ponsen
    Jan 24 '18 at 9:40

















2















I'm trying to use the transportbuilder to send an custom email in my module.
I succeed in sending an email, but the body is always empty.



This is my email_templates.xml (placed in view/frontend/email/)



 <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
</config>


And this is my mail function:



 $emailTemplateVariables = array();
$emailTempVariables['ucdata'] = 'dummy';

$sendToEmail = 'email@gmail.com';

$postObject = new MagentoFrameworkDataObject();
$postObject->setData($emailTempVariables);

$sender = array('email' => "info@mywebsite.nl", 'name' => 'Mywebsite');

$transport = $this->_transportBuilder->setTemplateIdentifier('empty_email_template')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom($sender)
->addTo($sendToEmail)
->setReplyTo($sender['email'])
->getTransport();
$bla = $transport->sendMessage();


And this is my template:



 <strong>De volgende producten zijn verwijderd door Lightmakers:</strong> <br><br>
<pre>
trans "Ucdata: %ucData" ucData=$data.ucdata
</pre>


The email is fully blank (no static template content aswell), but I don't get any error messages while sending.
Is there a way to debug this situation?










share|improve this question














bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • did you debug this?

    – CompactCode
    Dec 2 '17 at 18:46











  • Did you find the answer? Same issue here.

    – Coen Ponsen
    Jan 24 '18 at 9:40













2












2








2


0






I'm trying to use the transportbuilder to send an custom email in my module.
I succeed in sending an email, but the body is always empty.



This is my email_templates.xml (placed in view/frontend/email/)



 <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
</config>


And this is my mail function:



 $emailTemplateVariables = array();
$emailTempVariables['ucdata'] = 'dummy';

$sendToEmail = 'email@gmail.com';

$postObject = new MagentoFrameworkDataObject();
$postObject->setData($emailTempVariables);

$sender = array('email' => "info@mywebsite.nl", 'name' => 'Mywebsite');

$transport = $this->_transportBuilder->setTemplateIdentifier('empty_email_template')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom($sender)
->addTo($sendToEmail)
->setReplyTo($sender['email'])
->getTransport();
$bla = $transport->sendMessage();


And this is my template:



 <strong>De volgende producten zijn verwijderd door Lightmakers:</strong> <br><br>
<pre>
trans "Ucdata: %ucData" ucData=$data.ucdata
</pre>


The email is fully blank (no static template content aswell), but I don't get any error messages while sending.
Is there a way to debug this situation?










share|improve this question














I'm trying to use the transportbuilder to send an custom email in my module.
I succeed in sending an email, but the body is always empty.



This is my email_templates.xml (placed in view/frontend/email/)



 <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
</config>


And this is my mail function:



 $emailTemplateVariables = array();
$emailTempVariables['ucdata'] = 'dummy';

$sendToEmail = 'email@gmail.com';

$postObject = new MagentoFrameworkDataObject();
$postObject->setData($emailTempVariables);

$sender = array('email' => "info@mywebsite.nl", 'name' => 'Mywebsite');

$transport = $this->_transportBuilder->setTemplateIdentifier('empty_email_template')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom($sender)
->addTo($sendToEmail)
->setReplyTo($sender['email'])
->getTransport();
$bla = $transport->sendMessage();


And this is my template:



 <strong>De volgende producten zijn verwijderd door Lightmakers:</strong> <br><br>
<pre>
trans "Ucdata: %ucData" ucData=$data.ucdata
</pre>


The email is fully blank (no static template content aswell), but I don't get any error messages while sending.
Is there a way to debug this situation?







magento2 email






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 12 '16 at 15:27









XaiamediaXaiamedia

91129




91129





bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • did you debug this?

    – CompactCode
    Dec 2 '17 at 18:46











  • Did you find the answer? Same issue here.

    – Coen Ponsen
    Jan 24 '18 at 9:40

















  • did you debug this?

    – CompactCode
    Dec 2 '17 at 18:46











  • Did you find the answer? Same issue here.

    – Coen Ponsen
    Jan 24 '18 at 9:40
















did you debug this?

– CompactCode
Dec 2 '17 at 18:46





did you debug this?

– CompactCode
Dec 2 '17 at 18:46













Did you find the answer? Same issue here.

– Coen Ponsen
Jan 24 '18 at 9:40





Did you find the answer? Same issue here.

– Coen Ponsen
Jan 24 '18 at 9:40










2 Answers
2






active

oldest

votes


















0














Magento sending empty mail reason is module can not access email template.



Your Sending email code is ok.



You have some directory related issue in putting file .
Follow bellow step.



=> Step 1 : Put bellow email_templates.xml in Xaiamedia_SyncProducts/etc/ folder



<?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
</config>


=> Step 2 : put your defined html empty.html to bellow directory



Xaiamedia_SyncProducts/view/frontend/email/empty.html


All Done!






share|improve this answer
































    0














    <template id="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>


    Change



    `type="text"` to `type="html"`





    share|improve this answer























      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%2f140518%2fmagento-2-transportbuilder-sending-empty-mails%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Magento sending empty mail reason is module can not access email template.



      Your Sending email code is ok.



      You have some directory related issue in putting file .
      Follow bellow step.



      => Step 1 : Put bellow email_templates.xml in Xaiamedia_SyncProducts/etc/ folder



      <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
      </config>


      => Step 2 : put your defined html empty.html to bellow directory



      Xaiamedia_SyncProducts/view/frontend/email/empty.html


      All Done!






      share|improve this answer





























        0














        Magento sending empty mail reason is module can not access email template.



        Your Sending email code is ok.



        You have some directory related issue in putting file .
        Follow bellow step.



        => Step 1 : Put bellow email_templates.xml in Xaiamedia_SyncProducts/etc/ folder



        <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
        </config>


        => Step 2 : put your defined html empty.html to bellow directory



        Xaiamedia_SyncProducts/view/frontend/email/empty.html


        All Done!






        share|improve this answer



























          0












          0








          0







          Magento sending empty mail reason is module can not access email template.



          Your Sending email code is ok.



          You have some directory related issue in putting file .
          Follow bellow step.



          => Step 1 : Put bellow email_templates.xml in Xaiamedia_SyncProducts/etc/ folder



          <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
          </config>


          => Step 2 : put your defined html empty.html to bellow directory



          Xaiamedia_SyncProducts/view/frontend/email/empty.html


          All Done!






          share|improve this answer















          Magento sending empty mail reason is module can not access email template.



          Your Sending email code is ok.



          You have some directory related issue in putting file .
          Follow bellow step.



          => Step 1 : Put bellow email_templates.xml in Xaiamedia_SyncProducts/etc/ folder



          <?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="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>
          </config>


          => Step 2 : put your defined html empty.html to bellow directory



          Xaiamedia_SyncProducts/view/frontend/email/empty.html


          All Done!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 27 '18 at 8:37









          Rohan Hapani

          6,85431865




          6,85431865










          answered Dec 28 '17 at 10:58









          Abhinav SinghAbhinav Singh

          2,115612




          2,115612























              0














              <template id="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>


              Change



              `type="text"` to `type="html"`





              share|improve this answer



























                0














                <template id="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>


                Change



                `type="text"` to `type="html"`





                share|improve this answer

























                  0












                  0








                  0







                  <template id="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>


                  Change



                  `type="text"` to `type="html"`





                  share|improve this answer













                  <template id="empty_email_template" label="Empty Template" file="empty.html" type="text" module="Xaiamedia_SyncProducts" area="frontend"/>


                  Change



                  `type="text"` to `type="html"`






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 8 at 18:47









                  Magento DevMagento Dev

                  386




                  386



























                      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%2f140518%2fmagento-2-transportbuilder-sending-empty-mails%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

                      Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                      How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2

                      Nissan Patrol Зміст Перше покоління — 4W60 (1951-1960) | Друге покоління — 60 series (1960-1980) | Третє покоління (1980–2002) | Четверте покоління — Y60 (1987–1998) | П'яте покоління — Y61 (1997–2013) | Шосте покоління — Y62 (2010- ) | Посилання | Зноски | Навігаційне менюОфіційний український сайтТест-драйв Nissan Patrol 2010 7-го поколінняNissan PatrolКак мы тестировали Nissan Patrol 2016рвиправивши або дописавши її