Magento 2 send email programatically not working(error-Template file 'name_of_file.html' is not found.)how to send custom email no template in magento2?Send email of different template in Magentonot able to send email with email templateemail template file configurationCustom Email template not workingMagento 2 : Problem while adding custom button order view page?Magento 2 phtml file not called in email template filemagento 2.1.6 email template after save 404 not foundMagento 2: Email Template errorMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options

Emailing HOD to enhance faculty application

Is it legal for company to use my work email to pretend I still work there?

Brothers & sisters

Why doesn't H₄O²⁺ exist?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

Facing a paradox: Earnshaw's theorem in one dimension

How could indestructible materials be used in power generation?

Can I use a neutral wire from another outlet to repair a broken neutral?

Is it canonical bit space?

UK: Is there precedent for the governments e-petition site changing the direction of a government decision?

What is the word for reserving something for yourself before others do?

Watching something be written to a file live with tail

SSH "lag" in LAN on some machines, mixed distros

Can a virus destroy the BIOS of a modern computer?

Can one be a co-translator of a book, if he does not know the language that the book is translated into?

Do I have a twin with permutated remainders?

Should I tell management that I intend to leave due to bad software development practices?

In Romance of the Three Kingdoms why do people still use bamboo sticks when papers are already invented?

Does casting Light, or a similar spell, have any effect when the caster is swallowed by a monster?

Is it unprofessional to ask if a job posting on GlassDoor is real?

How can saying a song's name be a copyright violation?

How much of data wrangling is a data scientist's job?

Forgetting the musical notes while performing in concert

I Accidentally Deleted a Stock Terminal Theme



Magento 2 send email programatically not working(error-Template file 'name_of_file.html' is not found.)


how to send custom email no template in magento2?Send email of different template in Magentonot able to send email with email templateemail template file configurationCustom Email template not workingMagento 2 : Problem while adding custom button order view page?Magento 2 phtml file not called in email template filemagento 2.1.6 email template after save 404 not foundMagento 2: Email Template errorMagento 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;








0















Magento 2 send email(adminhtml) programatically not working.
i am using this code -



$report = [
'report_date' => date("j F Y", strtotime('-1 day')),
'orders_count' => rand(1, 10),
'order_items_count' => rand(1, 10),
'avg_items' => rand(1, 10)
];

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

$transport = $this->_transportBuilder
->setTemplateIdentifier('sendcredentials')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom(['name' => 'Robot','email' => 'robot@server.com'])
->addTo(['test@gmail.com', 'test@test.in'])
->getTransport();
$transport->sendMessage();


and email_templates.xml(location-etc)



<?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="sendcredentials" label="Test email" file="sendcredentials.html" type="html" module="Vendor_Sendcredentials" area="adminhtml"/>
</config>


and HTML file sendcredentials.html(location-view/adminhtml/email) -



<!--@subject Custom @-->
<h3>Report from raw</h3>

<p><b>Number of orders:</b> var data.orders_count</p>
<p><b>Items count:</b> var data.order_items_count</p>
<p><b>Average items per order:</b> raw</p>


I am getting this error -



Template file 'sendcredentials.html' is not found.










share|improve this question
























  • Which path you have the sendcredentials.html file?

    – Jeeva Chezhiyan
    yesterday











  • It suppose to be in view/adminhtml/email/ folder, Please verify it

    – Jeeva Chezhiyan
    yesterday











  • yes it is there,i commented my question

    – sumeet bajaj
    yesterday

















0















Magento 2 send email(adminhtml) programatically not working.
i am using this code -



$report = [
'report_date' => date("j F Y", strtotime('-1 day')),
'orders_count' => rand(1, 10),
'order_items_count' => rand(1, 10),
'avg_items' => rand(1, 10)
];

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

$transport = $this->_transportBuilder
->setTemplateIdentifier('sendcredentials')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom(['name' => 'Robot','email' => 'robot@server.com'])
->addTo(['test@gmail.com', 'test@test.in'])
->getTransport();
$transport->sendMessage();


and email_templates.xml(location-etc)



<?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="sendcredentials" label="Test email" file="sendcredentials.html" type="html" module="Vendor_Sendcredentials" area="adminhtml"/>
</config>


and HTML file sendcredentials.html(location-view/adminhtml/email) -



<!--@subject Custom @-->
<h3>Report from raw</h3>

<p><b>Number of orders:</b> var data.orders_count</p>
<p><b>Items count:</b> var data.order_items_count</p>
<p><b>Average items per order:</b> raw</p>


I am getting this error -



Template file 'sendcredentials.html' is not found.










share|improve this question
























  • Which path you have the sendcredentials.html file?

    – Jeeva Chezhiyan
    yesterday











  • It suppose to be in view/adminhtml/email/ folder, Please verify it

    – Jeeva Chezhiyan
    yesterday











  • yes it is there,i commented my question

    – sumeet bajaj
    yesterday













0












0








0








Magento 2 send email(adminhtml) programatically not working.
i am using this code -



$report = [
'report_date' => date("j F Y", strtotime('-1 day')),
'orders_count' => rand(1, 10),
'order_items_count' => rand(1, 10),
'avg_items' => rand(1, 10)
];

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

$transport = $this->_transportBuilder
->setTemplateIdentifier('sendcredentials')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom(['name' => 'Robot','email' => 'robot@server.com'])
->addTo(['test@gmail.com', 'test@test.in'])
->getTransport();
$transport->sendMessage();


and email_templates.xml(location-etc)



<?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="sendcredentials" label="Test email" file="sendcredentials.html" type="html" module="Vendor_Sendcredentials" area="adminhtml"/>
</config>


and HTML file sendcredentials.html(location-view/adminhtml/email) -



<!--@subject Custom @-->
<h3>Report from raw</h3>

<p><b>Number of orders:</b> var data.orders_count</p>
<p><b>Items count:</b> var data.order_items_count</p>
<p><b>Average items per order:</b> raw</p>


I am getting this error -



Template file 'sendcredentials.html' is not found.










share|improve this question
















Magento 2 send email(adminhtml) programatically not working.
i am using this code -



$report = [
'report_date' => date("j F Y", strtotime('-1 day')),
'orders_count' => rand(1, 10),
'order_items_count' => rand(1, 10),
'avg_items' => rand(1, 10)
];

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

$transport = $this->_transportBuilder
->setTemplateIdentifier('sendcredentials')
->setTemplateOptions(['area' => MagentoFrameworkAppArea::AREA_FRONTEND, 'store' => MagentoStoreModelStore::DEFAULT_STORE_ID])
->setTemplateVars(['data' => $postObject])
->setFrom(['name' => 'Robot','email' => 'robot@server.com'])
->addTo(['test@gmail.com', 'test@test.in'])
->getTransport();
$transport->sendMessage();


and email_templates.xml(location-etc)



<?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="sendcredentials" label="Test email" file="sendcredentials.html" type="html" module="Vendor_Sendcredentials" area="adminhtml"/>
</config>


and HTML file sendcredentials.html(location-view/adminhtml/email) -



<!--@subject Custom @-->
<h3>Report from raw</h3>

<p><b>Number of orders:</b> var data.orders_count</p>
<p><b>Items count:</b> var data.order_items_count</p>
<p><b>Average items per order:</b> raw</p>


I am getting this error -



Template file 'sendcredentials.html' is not found.







magento2 adminhtml email-templates






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







sumeet bajaj

















asked yesterday









sumeet bajajsumeet bajaj

929




929












  • Which path you have the sendcredentials.html file?

    – Jeeva Chezhiyan
    yesterday











  • It suppose to be in view/adminhtml/email/ folder, Please verify it

    – Jeeva Chezhiyan
    yesterday











  • yes it is there,i commented my question

    – sumeet bajaj
    yesterday

















  • Which path you have the sendcredentials.html file?

    – Jeeva Chezhiyan
    yesterday











  • It suppose to be in view/adminhtml/email/ folder, Please verify it

    – Jeeva Chezhiyan
    yesterday











  • yes it is there,i commented my question

    – sumeet bajaj
    yesterday
















Which path you have the sendcredentials.html file?

– Jeeva Chezhiyan
yesterday





Which path you have the sendcredentials.html file?

– Jeeva Chezhiyan
yesterday













It suppose to be in view/adminhtml/email/ folder, Please verify it

– Jeeva Chezhiyan
yesterday





It suppose to be in view/adminhtml/email/ folder, Please verify it

– Jeeva Chezhiyan
yesterday













yes it is there,i commented my question

– sumeet bajaj
yesterday





yes it is there,i commented my question

– sumeet bajaj
yesterday










1 Answer
1






active

oldest

votes


















0














I solved my self,changed area



from



'area' => MagentoFrameworkAppArea::AREA_FRONTEND,


to



'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,





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%2f268608%2fmagento-2-send-email-programatically-not-workingerror-template-file-name-of-fi%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 solved my self,changed area



    from



    'area' => MagentoFrameworkAppArea::AREA_FRONTEND,


    to



    'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,





    share|improve this answer



























      0














      I solved my self,changed area



      from



      'area' => MagentoFrameworkAppArea::AREA_FRONTEND,


      to



      'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,





      share|improve this answer

























        0












        0








        0







        I solved my self,changed area



        from



        'area' => MagentoFrameworkAppArea::AREA_FRONTEND,


        to



        'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,





        share|improve this answer













        I solved my self,changed area



        from



        'area' => MagentoFrameworkAppArea::AREA_FRONTEND,


        to



        'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        sumeet bajajsumeet bajaj

        929




        929



























            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%2f268608%2fmagento-2-send-email-programatically-not-workingerror-template-file-name-of-fi%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

            Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

            Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

            Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림