Incorrect behavior when sending email with use a block inside a templateMagento 1.8 - Display block in email templateCreating custom module in magento2 show fatal errorMagento2 custom email for custom moduleSending custom email for custom module - Magento2Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPathMagento 2 external PHP script with block output always has template hintsGENERATE THIS REPORT: main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_Creating product view block with custom template in controller action failsMagento 2 | Send email from observerMagento 2.3 Can't view module's front end page output?

What happens if you are holding an Iron Flask with a demon inside and walk into an Antimagic Field?

Using substitution ciphers to generate new alphabets in a novel

Open a doc from terminal, but not by its name

Can I still be respawned if I die by falling off the map?

What is Cash Advance APR?

Hero deduces identity of a killer

Multiplicative persistence

How to fade a semiplane defined by line?

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

Does the Linux kernel need a file system to run?

Why did the EU agree to delay the Brexit deadline?

Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?

putting logo on same line but after title, latex

Angel of Condemnation - Exile creature with second ability

How should I respond when I lied about my education and the company finds out through background check?

Can disgust be a key component of horror?

Limits and Infinite Integration by Parts

Mimic lecturing on blackboard, facing audience

Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?

Store Credit Card Information in Password Manager?

Why is it that I can sometimes guess the next note?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

What are the advantages of simplicial model categories over non-simplicial ones?



Incorrect behavior when sending email with use a block inside a template


Magento 1.8 - Display block in email templateCreating custom module in magento2 show fatal errorMagento2 custom email for custom moduleSending custom email for custom module - Magento2Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPathMagento 2 external PHP script with block output always has template hintsGENERATE THIS REPORT: main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_Creating product view block with custom template in controller action failsMagento 2 | Send email from observerMagento 2.3 Can't view module's front end page output?













1















When developing the module I encountered the following problem:
inside the my controller (class Index extends MagentoFrameworkAppActionAction) there is a method that calls a method to send email send() (inside class EmailSenderResultsSync extends AbstractHelper).



E-mail is sent and works well until the template file (view/frontend/email/sync-report/index.html) contains only html code, for example:



<h1>Title</h1>



But when I try to insert a block in the template as follows:



block class='Magento\Framework\View\Element\Template' area='frontend' template='<vendor>_<module>::email/sync-report/test.phtml'



an email is sent (along with the contents of the block) only 1 time. The next time you contact the controller (class Index extends MagentoFrameworkAppActionAction), it does not work. The controller does not perform any actions at all.



There is no information in the logs.



I hope for help, thank you!










share|improve this question







New contributor




Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    1















    When developing the module I encountered the following problem:
    inside the my controller (class Index extends MagentoFrameworkAppActionAction) there is a method that calls a method to send email send() (inside class EmailSenderResultsSync extends AbstractHelper).



    E-mail is sent and works well until the template file (view/frontend/email/sync-report/index.html) contains only html code, for example:



    <h1>Title</h1>



    But when I try to insert a block in the template as follows:



    block class='Magento\Framework\View\Element\Template' area='frontend' template='<vendor>_<module>::email/sync-report/test.phtml'



    an email is sent (along with the contents of the block) only 1 time. The next time you contact the controller (class Index extends MagentoFrameworkAppActionAction), it does not work. The controller does not perform any actions at all.



    There is no information in the logs.



    I hope for help, thank you!










    share|improve this question







    New contributor




    Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      1












      1








      1








      When developing the module I encountered the following problem:
      inside the my controller (class Index extends MagentoFrameworkAppActionAction) there is a method that calls a method to send email send() (inside class EmailSenderResultsSync extends AbstractHelper).



      E-mail is sent and works well until the template file (view/frontend/email/sync-report/index.html) contains only html code, for example:



      <h1>Title</h1>



      But when I try to insert a block in the template as follows:



      block class='Magento\Framework\View\Element\Template' area='frontend' template='<vendor>_<module>::email/sync-report/test.phtml'



      an email is sent (along with the contents of the block) only 1 time. The next time you contact the controller (class Index extends MagentoFrameworkAppActionAction), it does not work. The controller does not perform any actions at all.



      There is no information in the logs.



      I hope for help, thank you!










      share|improve this question







      New contributor




      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      When developing the module I encountered the following problem:
      inside the my controller (class Index extends MagentoFrameworkAppActionAction) there is a method that calls a method to send email send() (inside class EmailSenderResultsSync extends AbstractHelper).



      E-mail is sent and works well until the template file (view/frontend/email/sync-report/index.html) contains only html code, for example:



      <h1>Title</h1>



      But when I try to insert a block in the template as follows:



      block class='Magento\Framework\View\Element\Template' area='frontend' template='<vendor>_<module>::email/sync-report/test.phtml'



      an email is sent (along with the contents of the block) only 1 time. The next time you contact the controller (class Index extends MagentoFrameworkAppActionAction), it does not work. The controller does not perform any actions at all.



      There is no information in the logs.



      I hope for help, thank you!







      magento2 blocks template email






      share|improve this question







      New contributor




      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      VladislavVladislav

      62




      62




      New contributor




      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Vladislav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You cannot call block like this in email template.
          Here You have allowed customizations for magento 2:
          https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-email.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
            );



            );






            Vladislav is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266859%2fincorrect-behavior-when-sending-email-with-use-a-block-inside-a-template%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You cannot call block like this in email template.
            Here You have allowed customizations for magento 2:
            https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-email.html






            share|improve this answer



























              0














              You cannot call block like this in email template.
              Here You have allowed customizations for magento 2:
              https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-email.html






              share|improve this answer

























                0












                0








                0







                You cannot call block like this in email template.
                Here You have allowed customizations for magento 2:
                https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-email.html






                share|improve this answer













                You cannot call block like this in email template.
                Here You have allowed customizations for magento 2:
                https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-email.html







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                lama377lama377

                16




                16




















                    Vladislav is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    Vladislav is a new contributor. Be nice, and check out our Code of Conduct.












                    Vladislav is a new contributor. Be nice, and check out our Code of Conduct.











                    Vladislav is a new contributor. Be nice, and check out our Code of Conduct.














                    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%2f266859%2fincorrect-behavior-when-sending-email-with-use-a-block-inside-a-template%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

                    Sum ergo cogito? 1 nng

                    419 nièngy_Soadمي 19bal1.5o_g

                    Queiggey Chernihivv 9NnOo i Zw X QqKk LpB