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;
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
add a comment |
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
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
add a comment |
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
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
magento2 adminhtml email-templates
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
I solved my self,changed area
from
'area' => MagentoFrameworkAppArea::AREA_FRONTEND,
to
'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
I solved my self,changed area
from
'area' => MagentoFrameworkAppArea::AREA_FRONTEND,
to
'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,
add a comment |
I solved my self,changed area
from
'area' => MagentoFrameworkAppArea::AREA_FRONTEND,
to
'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,
add a comment |
I solved my self,changed area
from
'area' => MagentoFrameworkAppArea::AREA_FRONTEND,
to
'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,
I solved my self,changed area
from
'area' => MagentoFrameworkAppArea::AREA_FRONTEND,
to
'area' => MagentoFrameworkAppArea::AREA_ADMINHTML,
answered yesterday
sumeet bajajsumeet bajaj
929
929
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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