Magento 2 - Debugging Hints showing on emails sent programmaticallyMagento 2 debugging SystemM2 Debugging - Layout Container Hints?Magento 2 timing of transactional emails sentMagento 2 emails not being sent on VPSMagento 2.1.6 No confirmation emails sent from frontendMagento 2 - multiple emails sent only over 3 accountsTemplate Path Hints not showing on front-end in magento2All Transaction Emails Getting Sent Only from 'postmaster@example.com'Magento2.3 w/ php7.2 - Emails not being sentShipment emails not being sent even though other emails are working

What is the effect and/or good reasons of changing a paper bill to a coin?

How to avoid unconsciously copying the style of my favorite writer?

What's the difference between 2a and 10a charging options?

What do I do when a student working in my lab "ghosts" me?

Invert Some Switches on a Switchboard

How do I generate distribution of positive numbers only with min, max and mean?

3D Statue Park: U shapes

Is it normal practice to screen share with a client?

Examples of simultaneous independent breakthroughs

Expansion with *.txt in the shell doesn't work if no .txt file exists

What to do when you reach a conclusion and find out later on that someone else already did?

How can I create a pattern of parallel lines that are increasing in distance in Photoshop / Illustrator?

Convert a string like 4h53m12s to a total number of seconds in JavaScript

Why are so many countries still in the Commonwealth?

USA: Can a witness take the 5th to avoid perjury?

Commercial jet accompanied by small plane near Seattle

Why was Sauron preparing for war instead of trying to find the ring?

How do I run a game when my PCs have different approaches to combat?

How do professional electronic musicians/sound engineers combat listening fatigue?

Where to place an artificial gland in the human body?

This message is flooding my syslog, how to find where it comes from?

How do we explain the E major chord in this progression?

How can I stop myself from micromanaging other PCs' actions?

Replacing tongue and groove floorboards: but can't find a match



Magento 2 - Debugging Hints showing on emails sent programmatically


Magento 2 debugging SystemM2 Debugging - Layout Container Hints?Magento 2 timing of transactional emails sentMagento 2 emails not being sent on VPSMagento 2.1.6 No confirmation emails sent from frontendMagento 2 - multiple emails sent only over 3 accountsTemplate Path Hints not showing on front-end in magento2All Transaction Emails Getting Sent Only from 'postmaster@example.com'Magento2.3 w/ php7.2 - Emails not being sentShipment emails not being sent even though other emails are working






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








4















I have a bootstrap script that is used to mark orders as shipped. After shipping the order it used ShipmentNotifier to send out the shipment email. Despite Debugging Hints being turned off everywhere, the email that it sends still includes the red path hints.



I have tried setting the script to run in the 'frontend' state instead of 'adminhtml', but it makes no difference, the red boxes remain.



If I send the email out manually using the Magento backend then it sends correctly (no debug hints). This leaves me to believe there is something I am missing in the bootstrap script.



Has anyone encountered this issue before? What did you do to resolve it?



// Register shipment
$shipment->register();
$shipment->getOrder()->setIsInProcess(true);

try

// Save created shipment and order
$shipment->save();
$shipment->getOrder()->save();

catch (Exception $e)

echo "<font color=red><b>EXCEPTION: </b></font>". $e->getMessage(); exit;


//send email
$shipmentNotifier = $objectManager->create('MagentoShippingModelShipmentNotifier');
$shipmentNotifier->notify($shipment);


Screenshot of Email










share|improve this question




























    4















    I have a bootstrap script that is used to mark orders as shipped. After shipping the order it used ShipmentNotifier to send out the shipment email. Despite Debugging Hints being turned off everywhere, the email that it sends still includes the red path hints.



    I have tried setting the script to run in the 'frontend' state instead of 'adminhtml', but it makes no difference, the red boxes remain.



    If I send the email out manually using the Magento backend then it sends correctly (no debug hints). This leaves me to believe there is something I am missing in the bootstrap script.



    Has anyone encountered this issue before? What did you do to resolve it?



    // Register shipment
    $shipment->register();
    $shipment->getOrder()->setIsInProcess(true);

    try

    // Save created shipment and order
    $shipment->save();
    $shipment->getOrder()->save();

    catch (Exception $e)

    echo "<font color=red><b>EXCEPTION: </b></font>". $e->getMessage(); exit;


    //send email
    $shipmentNotifier = $objectManager->create('MagentoShippingModelShipmentNotifier');
    $shipmentNotifier->notify($shipment);


    Screenshot of Email










    share|improve this question
























      4












      4








      4








      I have a bootstrap script that is used to mark orders as shipped. After shipping the order it used ShipmentNotifier to send out the shipment email. Despite Debugging Hints being turned off everywhere, the email that it sends still includes the red path hints.



      I have tried setting the script to run in the 'frontend' state instead of 'adminhtml', but it makes no difference, the red boxes remain.



      If I send the email out manually using the Magento backend then it sends correctly (no debug hints). This leaves me to believe there is something I am missing in the bootstrap script.



      Has anyone encountered this issue before? What did you do to resolve it?



      // Register shipment
      $shipment->register();
      $shipment->getOrder()->setIsInProcess(true);

      try

      // Save created shipment and order
      $shipment->save();
      $shipment->getOrder()->save();

      catch (Exception $e)

      echo "<font color=red><b>EXCEPTION: </b></font>". $e->getMessage(); exit;


      //send email
      $shipmentNotifier = $objectManager->create('MagentoShippingModelShipmentNotifier');
      $shipmentNotifier->notify($shipment);


      Screenshot of Email










      share|improve this question














      I have a bootstrap script that is used to mark orders as shipped. After shipping the order it used ShipmentNotifier to send out the shipment email. Despite Debugging Hints being turned off everywhere, the email that it sends still includes the red path hints.



      I have tried setting the script to run in the 'frontend' state instead of 'adminhtml', but it makes no difference, the red boxes remain.



      If I send the email out manually using the Magento backend then it sends correctly (no debug hints). This leaves me to believe there is something I am missing in the bootstrap script.



      Has anyone encountered this issue before? What did you do to resolve it?



      // Register shipment
      $shipment->register();
      $shipment->getOrder()->setIsInProcess(true);

      try

      // Save created shipment and order
      $shipment->save();
      $shipment->getOrder()->save();

      catch (Exception $e)

      echo "<font color=red><b>EXCEPTION: </b></font>". $e->getMessage(); exit;


      //send email
      $shipmentNotifier = $objectManager->create('MagentoShippingModelShipmentNotifier');
      $shipmentNotifier->notify($shipment);


      Screenshot of Email







      magento2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 9 at 4:40









      LihytLihyt

      212 bronze badges




      212 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I could solve this the following way



          public function __construct(MagentoStoreModelStoreManagerInterface $storeManager,
          MagentoFrameworkObjectManagerInterface $objectManager,
          MagentoFrameworkObjectManagerConfigLoaderInterface $configLoader,
          MagentoFrameworkAppAreaList $areaList)

          $this->storeManager = $storeManager;
          $this->objectManager = $objectManager;
          $this->configLoader = $configLoader;
          $this->areaList = $areaList;



          ...

          public function init()
          ...

          $this->objectManager->configure($this->configLoader->load('frontend'));

          $localeInterface = $this->objectManager->create('MagentoFrameworkTranslateInterface');
          $localeInterface->setLocale('de_DE');
          $localeInterface->loadData();

          $areaObject = $this->areaList->getArea(MagentoFrameworkAppArea::AREA_ADMINHTML);
          $areaObject->load(MagentoFrameworkAppArea::PART_TRANSLATE);

          ...



          My problem was that i had the email debug path inside the mails. This is caused by magento itself, because magento won´t set any store view or load languages or translations in a cron / command. So you need to set it by yourself.



          We have 1 location of sending an email - when creating a shipment - and here it works like a charm. The email looks - like it should - the same like if i would create a shipment in the backend manually.



          It is a shame for magento that there is no "preloading" of translations, store views or helper functions for commands, like setting the language / store view.



          You are not the only one with the problem, i have seen much more threads. And nobody could help, which is very unusual for Magento. I hope I could help you further :-)






          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%2f265099%2fmagento-2-debugging-hints-showing-on-emails-sent-programmatically%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














            I could solve this the following way



            public function __construct(MagentoStoreModelStoreManagerInterface $storeManager,
            MagentoFrameworkObjectManagerInterface $objectManager,
            MagentoFrameworkObjectManagerConfigLoaderInterface $configLoader,
            MagentoFrameworkAppAreaList $areaList)

            $this->storeManager = $storeManager;
            $this->objectManager = $objectManager;
            $this->configLoader = $configLoader;
            $this->areaList = $areaList;



            ...

            public function init()
            ...

            $this->objectManager->configure($this->configLoader->load('frontend'));

            $localeInterface = $this->objectManager->create('MagentoFrameworkTranslateInterface');
            $localeInterface->setLocale('de_DE');
            $localeInterface->loadData();

            $areaObject = $this->areaList->getArea(MagentoFrameworkAppArea::AREA_ADMINHTML);
            $areaObject->load(MagentoFrameworkAppArea::PART_TRANSLATE);

            ...



            My problem was that i had the email debug path inside the mails. This is caused by magento itself, because magento won´t set any store view or load languages or translations in a cron / command. So you need to set it by yourself.



            We have 1 location of sending an email - when creating a shipment - and here it works like a charm. The email looks - like it should - the same like if i would create a shipment in the backend manually.



            It is a shame for magento that there is no "preloading" of translations, store views or helper functions for commands, like setting the language / store view.



            You are not the only one with the problem, i have seen much more threads. And nobody could help, which is very unusual for Magento. I hope I could help you further :-)






            share|improve this answer



























              0














              I could solve this the following way



              public function __construct(MagentoStoreModelStoreManagerInterface $storeManager,
              MagentoFrameworkObjectManagerInterface $objectManager,
              MagentoFrameworkObjectManagerConfigLoaderInterface $configLoader,
              MagentoFrameworkAppAreaList $areaList)

              $this->storeManager = $storeManager;
              $this->objectManager = $objectManager;
              $this->configLoader = $configLoader;
              $this->areaList = $areaList;



              ...

              public function init()
              ...

              $this->objectManager->configure($this->configLoader->load('frontend'));

              $localeInterface = $this->objectManager->create('MagentoFrameworkTranslateInterface');
              $localeInterface->setLocale('de_DE');
              $localeInterface->loadData();

              $areaObject = $this->areaList->getArea(MagentoFrameworkAppArea::AREA_ADMINHTML);
              $areaObject->load(MagentoFrameworkAppArea::PART_TRANSLATE);

              ...



              My problem was that i had the email debug path inside the mails. This is caused by magento itself, because magento won´t set any store view or load languages or translations in a cron / command. So you need to set it by yourself.



              We have 1 location of sending an email - when creating a shipment - and here it works like a charm. The email looks - like it should - the same like if i would create a shipment in the backend manually.



              It is a shame for magento that there is no "preloading" of translations, store views or helper functions for commands, like setting the language / store view.



              You are not the only one with the problem, i have seen much more threads. And nobody could help, which is very unusual for Magento. I hope I could help you further :-)






              share|improve this answer

























                0












                0








                0







                I could solve this the following way



                public function __construct(MagentoStoreModelStoreManagerInterface $storeManager,
                MagentoFrameworkObjectManagerInterface $objectManager,
                MagentoFrameworkObjectManagerConfigLoaderInterface $configLoader,
                MagentoFrameworkAppAreaList $areaList)

                $this->storeManager = $storeManager;
                $this->objectManager = $objectManager;
                $this->configLoader = $configLoader;
                $this->areaList = $areaList;



                ...

                public function init()
                ...

                $this->objectManager->configure($this->configLoader->load('frontend'));

                $localeInterface = $this->objectManager->create('MagentoFrameworkTranslateInterface');
                $localeInterface->setLocale('de_DE');
                $localeInterface->loadData();

                $areaObject = $this->areaList->getArea(MagentoFrameworkAppArea::AREA_ADMINHTML);
                $areaObject->load(MagentoFrameworkAppArea::PART_TRANSLATE);

                ...



                My problem was that i had the email debug path inside the mails. This is caused by magento itself, because magento won´t set any store view or load languages or translations in a cron / command. So you need to set it by yourself.



                We have 1 location of sending an email - when creating a shipment - and here it works like a charm. The email looks - like it should - the same like if i would create a shipment in the backend manually.



                It is a shame for magento that there is no "preloading" of translations, store views or helper functions for commands, like setting the language / store view.



                You are not the only one with the problem, i have seen much more threads. And nobody could help, which is very unusual for Magento. I hope I could help you further :-)






                share|improve this answer













                I could solve this the following way



                public function __construct(MagentoStoreModelStoreManagerInterface $storeManager,
                MagentoFrameworkObjectManagerInterface $objectManager,
                MagentoFrameworkObjectManagerConfigLoaderInterface $configLoader,
                MagentoFrameworkAppAreaList $areaList)

                $this->storeManager = $storeManager;
                $this->objectManager = $objectManager;
                $this->configLoader = $configLoader;
                $this->areaList = $areaList;



                ...

                public function init()
                ...

                $this->objectManager->configure($this->configLoader->load('frontend'));

                $localeInterface = $this->objectManager->create('MagentoFrameworkTranslateInterface');
                $localeInterface->setLocale('de_DE');
                $localeInterface->loadData();

                $areaObject = $this->areaList->getArea(MagentoFrameworkAppArea::AREA_ADMINHTML);
                $areaObject->load(MagentoFrameworkAppArea::PART_TRANSLATE);

                ...



                My problem was that i had the email debug path inside the mails. This is caused by magento itself, because magento won´t set any store view or load languages or translations in a cron / command. So you need to set it by yourself.



                We have 1 location of sending an email - when creating a shipment - and here it works like a charm. The email looks - like it should - the same like if i would create a shipment in the backend manually.



                It is a shame for magento that there is no "preloading" of translations, store views or helper functions for commands, like setting the language / store view.



                You are not the only one with the problem, i have seen much more threads. And nobody could help, which is very unusual for Magento. I hope I could help you further :-)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 17 at 12:37









                Chris SchrutChris Schrut

                1




                1



























                    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%2f265099%2fmagento-2-debugging-hints-showing-on-emails-sent-programmatically%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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form