Send transactional email from root folder magento 2Magento2 get email templates dropdown in stores configurationMagento transactional email shows and old template even after styling itCreate transactional email via install/upgrade scriptSend email with magentoTransactional email templates not loadingOverriding send email functions with custom functionsMagento transactional email template variables assigned are not used by templateMagento2- Send custom transactional emailsMagento 2 Transactional Email VariablesMagento send Custom emailMagento transactional email new order email template product image missing
Is the destination of a commercial flight important for the pilot?
How can a function with a hole (removable discontinuity) equal a function with no hole?
Anatomically Correct Strange Women In Ponds Distributing Swords
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
Is expanding the research of a group into machine learning as a PhD student risky?
Large drywall patch supports
System.debug(JSON.Serialize(o)) Not longer shows full string
How does the UK government determine the size of a mandate?
Lay out the Carpet
Sequence of Tenses: Translating the subjunctive
How did Arya survive the stabbing?
How do I rename a Linux host without needing to reboot for the rename to take effect?
Hostile work environment after whistle-blowing on coworker and our boss. What do I do?
What can we do to stop prior company from asking us questions?
A problem in Probability theory
Implement the Thanos sorting algorithm
How do I extract a value from a time formatted value in excel?
Pre-amplifier input protection
What is the best translation for "slot" in the context of multiplayer video games?
How to be diplomatic in refusing to write code that breaches the privacy of our users
How to pronounce the slash sign
Energy of the particles in the particle accelerator
Crossing the line between justified force and brutality
Sort a list by elements of another list
Send transactional email from root folder magento 2
Magento2 get email templates dropdown in stores configurationMagento transactional email shows and old template even after styling itCreate transactional email via install/upgrade scriptSend email with magentoTransactional email templates not loadingOverriding send email functions with custom functionsMagento transactional email template variables assigned are not used by templateMagento2- Send custom transactional emailsMagento 2 Transactional Email VariablesMagento send Custom emailMagento transactional email new order email template product image missing
How to send transactional email template from Magento 2 root folder?
magento2 email-templates
add a comment |
How to send transactional email template from Magento 2 root folder?
magento2 email-templates
add a comment |
How to send transactional email template from Magento 2 root folder?
magento2 email-templates
How to send transactional email template from Magento 2 root folder?
magento2 email-templates
magento2 email-templates
edited Aug 24 '17 at 9:30
Teja Bhagavan Kollepara
3,01141949
3,01141949
asked Jul 12 '17 at 9:38
RaghuRaghu
1,2861520
1,2861520
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Developed a module for email setup by referring the blog for the requirement: https://webkul.com/blog/magento-2-send-transactional-email-programmatically-in-your-custom-module/
Here I have modified the helper class according the usage as follows:
<?php
namespace VendorNameCustomModuleHelper;
use MagentoFrameworkAppArea;
class Emailreport extends MagentoFrameworkAppHelperAbstractHelper
/**
* @var MagentoFrameworkAppConfigScopeConfigInterface
*/
protected $_scopeConfig;
/**
* Store manager
*
* @var MagentoStoreModelStoreManagerInterface
*/
protected $_storeManager;
/**
* @var MagentoFrameworkTranslateInlineStateInterface
*/
protected $inlineTranslation;
/**
* @var MagentoFrameworkMailTemplateTransportBuilder
*/
protected $_transportBuilder;
/**
* @param MagentoFrameworkAppHelperContext $context
* @param MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
* @param MagentoStoreModelStoreManagerInterface $storeManager
* @param MagentoFrameworkTranslateInlineStateInterface $inlineTranslation
* @param MagentoFrameworkMailTemplateTransportBuilder $transportBuilder
*/
public function __construct(
MagentoFrameworkAppHelperContext $context,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkTranslateInlineStateInterface $inlineTranslation,
MagentoFrameworkMailTemplateTransportBuilder $transportBuilder,
MagentoFrameworkAppState $state
)
$this->_scopeConfig = $context;
parent::__construct($context);
$this->_storeManager = $storeManager;
$this->inlineTranslation = $inlineTranslation;
$this->_transportBuilder = $transportBuilder;
$state->setAreaCode('frontend');
/**
* @param string $path
* @param int $storeId
* @return mixed
*/
protected function getConfigValue($path, $storeId)
return $this->scopeConfig->getValue(
$path,
MagentoStoreModelScopeInterface::SCOPE_STORE,
$storeId
);
/**
* Return store
*
* @return Store
*/
public function getStore()
return $this->_storeManager->getStore();
public function sendEmailReport(
$template,
$senderInfo,
$receiverInfo,
$templateParams = []
)
$this->inlineTranslation->suspend();
$templateId = $this->getConfigValue($template, $this->getStore()->getStoreId());
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
->setTemplateOptions(
[
'area' => Area::AREA_FRONTEND,
'store' => $this->getStore()->getId(),
]
)
->setTemplateVars($templateParams)
->setFrom($senderInfo)
->addTo($receiverInfo['email'],$receiverInfo['name'])
->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();
return $this;
Now using the following code we can able to trigger the email from root folder:
<?php
use MagentoFrameworkAppBootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$customEmailPath = 'contact/email/email_template'; // section_id/group_id/field_id
/* Sender Detail */
$senderInfo = [
'name' => 'sender',
'email' => 'sender@domain.com'
];
/* Receiver Detail */
$receiverInfo = [
'name' => 'receiver',
'email' => 'receiver@domain.com'
];
/* To assign the values to template variables */
$customerDetails = array();
$customerDetails['name'] = 'John Doe';
$customerDetails['email'] = 'test@example.com';
$objectManager->get('VendorNameCustomModuleHelperEmailreport')->sendEmailReport(
$customEmailPath,
$senderInfo,
$receiverInfo,
$customerDetails = []
);
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
|
show 2 more comments
I have created above two mentioned file. I have run file on root. I am getting null values in email template as below image.
New contributor
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%2f183281%2fsend-transactional-email-from-root-folder-magento-2%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
Developed a module for email setup by referring the blog for the requirement: https://webkul.com/blog/magento-2-send-transactional-email-programmatically-in-your-custom-module/
Here I have modified the helper class according the usage as follows:
<?php
namespace VendorNameCustomModuleHelper;
use MagentoFrameworkAppArea;
class Emailreport extends MagentoFrameworkAppHelperAbstractHelper
/**
* @var MagentoFrameworkAppConfigScopeConfigInterface
*/
protected $_scopeConfig;
/**
* Store manager
*
* @var MagentoStoreModelStoreManagerInterface
*/
protected $_storeManager;
/**
* @var MagentoFrameworkTranslateInlineStateInterface
*/
protected $inlineTranslation;
/**
* @var MagentoFrameworkMailTemplateTransportBuilder
*/
protected $_transportBuilder;
/**
* @param MagentoFrameworkAppHelperContext $context
* @param MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
* @param MagentoStoreModelStoreManagerInterface $storeManager
* @param MagentoFrameworkTranslateInlineStateInterface $inlineTranslation
* @param MagentoFrameworkMailTemplateTransportBuilder $transportBuilder
*/
public function __construct(
MagentoFrameworkAppHelperContext $context,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkTranslateInlineStateInterface $inlineTranslation,
MagentoFrameworkMailTemplateTransportBuilder $transportBuilder,
MagentoFrameworkAppState $state
)
$this->_scopeConfig = $context;
parent::__construct($context);
$this->_storeManager = $storeManager;
$this->inlineTranslation = $inlineTranslation;
$this->_transportBuilder = $transportBuilder;
$state->setAreaCode('frontend');
/**
* @param string $path
* @param int $storeId
* @return mixed
*/
protected function getConfigValue($path, $storeId)
return $this->scopeConfig->getValue(
$path,
MagentoStoreModelScopeInterface::SCOPE_STORE,
$storeId
);
/**
* Return store
*
* @return Store
*/
public function getStore()
return $this->_storeManager->getStore();
public function sendEmailReport(
$template,
$senderInfo,
$receiverInfo,
$templateParams = []
)
$this->inlineTranslation->suspend();
$templateId = $this->getConfigValue($template, $this->getStore()->getStoreId());
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
->setTemplateOptions(
[
'area' => Area::AREA_FRONTEND,
'store' => $this->getStore()->getId(),
]
)
->setTemplateVars($templateParams)
->setFrom($senderInfo)
->addTo($receiverInfo['email'],$receiverInfo['name'])
->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();
return $this;
Now using the following code we can able to trigger the email from root folder:
<?php
use MagentoFrameworkAppBootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$customEmailPath = 'contact/email/email_template'; // section_id/group_id/field_id
/* Sender Detail */
$senderInfo = [
'name' => 'sender',
'email' => 'sender@domain.com'
];
/* Receiver Detail */
$receiverInfo = [
'name' => 'receiver',
'email' => 'receiver@domain.com'
];
/* To assign the values to template variables */
$customerDetails = array();
$customerDetails['name'] = 'John Doe';
$customerDetails['email'] = 'test@example.com';
$objectManager->get('VendorNameCustomModuleHelperEmailreport')->sendEmailReport(
$customEmailPath,
$senderInfo,
$receiverInfo,
$customerDetails = []
);
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
|
show 2 more comments
Developed a module for email setup by referring the blog for the requirement: https://webkul.com/blog/magento-2-send-transactional-email-programmatically-in-your-custom-module/
Here I have modified the helper class according the usage as follows:
<?php
namespace VendorNameCustomModuleHelper;
use MagentoFrameworkAppArea;
class Emailreport extends MagentoFrameworkAppHelperAbstractHelper
/**
* @var MagentoFrameworkAppConfigScopeConfigInterface
*/
protected $_scopeConfig;
/**
* Store manager
*
* @var MagentoStoreModelStoreManagerInterface
*/
protected $_storeManager;
/**
* @var MagentoFrameworkTranslateInlineStateInterface
*/
protected $inlineTranslation;
/**
* @var MagentoFrameworkMailTemplateTransportBuilder
*/
protected $_transportBuilder;
/**
* @param MagentoFrameworkAppHelperContext $context
* @param MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
* @param MagentoStoreModelStoreManagerInterface $storeManager
* @param MagentoFrameworkTranslateInlineStateInterface $inlineTranslation
* @param MagentoFrameworkMailTemplateTransportBuilder $transportBuilder
*/
public function __construct(
MagentoFrameworkAppHelperContext $context,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkTranslateInlineStateInterface $inlineTranslation,
MagentoFrameworkMailTemplateTransportBuilder $transportBuilder,
MagentoFrameworkAppState $state
)
$this->_scopeConfig = $context;
parent::__construct($context);
$this->_storeManager = $storeManager;
$this->inlineTranslation = $inlineTranslation;
$this->_transportBuilder = $transportBuilder;
$state->setAreaCode('frontend');
/**
* @param string $path
* @param int $storeId
* @return mixed
*/
protected function getConfigValue($path, $storeId)
return $this->scopeConfig->getValue(
$path,
MagentoStoreModelScopeInterface::SCOPE_STORE,
$storeId
);
/**
* Return store
*
* @return Store
*/
public function getStore()
return $this->_storeManager->getStore();
public function sendEmailReport(
$template,
$senderInfo,
$receiverInfo,
$templateParams = []
)
$this->inlineTranslation->suspend();
$templateId = $this->getConfigValue($template, $this->getStore()->getStoreId());
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
->setTemplateOptions(
[
'area' => Area::AREA_FRONTEND,
'store' => $this->getStore()->getId(),
]
)
->setTemplateVars($templateParams)
->setFrom($senderInfo)
->addTo($receiverInfo['email'],$receiverInfo['name'])
->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();
return $this;
Now using the following code we can able to trigger the email from root folder:
<?php
use MagentoFrameworkAppBootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$customEmailPath = 'contact/email/email_template'; // section_id/group_id/field_id
/* Sender Detail */
$senderInfo = [
'name' => 'sender',
'email' => 'sender@domain.com'
];
/* Receiver Detail */
$receiverInfo = [
'name' => 'receiver',
'email' => 'receiver@domain.com'
];
/* To assign the values to template variables */
$customerDetails = array();
$customerDetails['name'] = 'John Doe';
$customerDetails['email'] = 'test@example.com';
$objectManager->get('VendorNameCustomModuleHelperEmailreport')->sendEmailReport(
$customEmailPath,
$senderInfo,
$receiverInfo,
$customerDetails = []
);
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
|
show 2 more comments
Developed a module for email setup by referring the blog for the requirement: https://webkul.com/blog/magento-2-send-transactional-email-programmatically-in-your-custom-module/
Here I have modified the helper class according the usage as follows:
<?php
namespace VendorNameCustomModuleHelper;
use MagentoFrameworkAppArea;
class Emailreport extends MagentoFrameworkAppHelperAbstractHelper
/**
* @var MagentoFrameworkAppConfigScopeConfigInterface
*/
protected $_scopeConfig;
/**
* Store manager
*
* @var MagentoStoreModelStoreManagerInterface
*/
protected $_storeManager;
/**
* @var MagentoFrameworkTranslateInlineStateInterface
*/
protected $inlineTranslation;
/**
* @var MagentoFrameworkMailTemplateTransportBuilder
*/
protected $_transportBuilder;
/**
* @param MagentoFrameworkAppHelperContext $context
* @param MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
* @param MagentoStoreModelStoreManagerInterface $storeManager
* @param MagentoFrameworkTranslateInlineStateInterface $inlineTranslation
* @param MagentoFrameworkMailTemplateTransportBuilder $transportBuilder
*/
public function __construct(
MagentoFrameworkAppHelperContext $context,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkTranslateInlineStateInterface $inlineTranslation,
MagentoFrameworkMailTemplateTransportBuilder $transportBuilder,
MagentoFrameworkAppState $state
)
$this->_scopeConfig = $context;
parent::__construct($context);
$this->_storeManager = $storeManager;
$this->inlineTranslation = $inlineTranslation;
$this->_transportBuilder = $transportBuilder;
$state->setAreaCode('frontend');
/**
* @param string $path
* @param int $storeId
* @return mixed
*/
protected function getConfigValue($path, $storeId)
return $this->scopeConfig->getValue(
$path,
MagentoStoreModelScopeInterface::SCOPE_STORE,
$storeId
);
/**
* Return store
*
* @return Store
*/
public function getStore()
return $this->_storeManager->getStore();
public function sendEmailReport(
$template,
$senderInfo,
$receiverInfo,
$templateParams = []
)
$this->inlineTranslation->suspend();
$templateId = $this->getConfigValue($template, $this->getStore()->getStoreId());
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
->setTemplateOptions(
[
'area' => Area::AREA_FRONTEND,
'store' => $this->getStore()->getId(),
]
)
->setTemplateVars($templateParams)
->setFrom($senderInfo)
->addTo($receiverInfo['email'],$receiverInfo['name'])
->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();
return $this;
Now using the following code we can able to trigger the email from root folder:
<?php
use MagentoFrameworkAppBootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$customEmailPath = 'contact/email/email_template'; // section_id/group_id/field_id
/* Sender Detail */
$senderInfo = [
'name' => 'sender',
'email' => 'sender@domain.com'
];
/* Receiver Detail */
$receiverInfo = [
'name' => 'receiver',
'email' => 'receiver@domain.com'
];
/* To assign the values to template variables */
$customerDetails = array();
$customerDetails['name'] = 'John Doe';
$customerDetails['email'] = 'test@example.com';
$objectManager->get('VendorNameCustomModuleHelperEmailreport')->sendEmailReport(
$customEmailPath,
$senderInfo,
$receiverInfo,
$customerDetails = []
);
Developed a module for email setup by referring the blog for the requirement: https://webkul.com/blog/magento-2-send-transactional-email-programmatically-in-your-custom-module/
Here I have modified the helper class according the usage as follows:
<?php
namespace VendorNameCustomModuleHelper;
use MagentoFrameworkAppArea;
class Emailreport extends MagentoFrameworkAppHelperAbstractHelper
/**
* @var MagentoFrameworkAppConfigScopeConfigInterface
*/
protected $_scopeConfig;
/**
* Store manager
*
* @var MagentoStoreModelStoreManagerInterface
*/
protected $_storeManager;
/**
* @var MagentoFrameworkTranslateInlineStateInterface
*/
protected $inlineTranslation;
/**
* @var MagentoFrameworkMailTemplateTransportBuilder
*/
protected $_transportBuilder;
/**
* @param MagentoFrameworkAppHelperContext $context
* @param MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
* @param MagentoStoreModelStoreManagerInterface $storeManager
* @param MagentoFrameworkTranslateInlineStateInterface $inlineTranslation
* @param MagentoFrameworkMailTemplateTransportBuilder $transportBuilder
*/
public function __construct(
MagentoFrameworkAppHelperContext $context,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkTranslateInlineStateInterface $inlineTranslation,
MagentoFrameworkMailTemplateTransportBuilder $transportBuilder,
MagentoFrameworkAppState $state
)
$this->_scopeConfig = $context;
parent::__construct($context);
$this->_storeManager = $storeManager;
$this->inlineTranslation = $inlineTranslation;
$this->_transportBuilder = $transportBuilder;
$state->setAreaCode('frontend');
/**
* @param string $path
* @param int $storeId
* @return mixed
*/
protected function getConfigValue($path, $storeId)
return $this->scopeConfig->getValue(
$path,
MagentoStoreModelScopeInterface::SCOPE_STORE,
$storeId
);
/**
* Return store
*
* @return Store
*/
public function getStore()
return $this->_storeManager->getStore();
public function sendEmailReport(
$template,
$senderInfo,
$receiverInfo,
$templateParams = []
)
$this->inlineTranslation->suspend();
$templateId = $this->getConfigValue($template, $this->getStore()->getStoreId());
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
->setTemplateOptions(
[
'area' => Area::AREA_FRONTEND,
'store' => $this->getStore()->getId(),
]
)
->setTemplateVars($templateParams)
->setFrom($senderInfo)
->addTo($receiverInfo['email'],$receiverInfo['name'])
->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();
return $this;
Now using the following code we can able to trigger the email from root folder:
<?php
use MagentoFrameworkAppBootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$customEmailPath = 'contact/email/email_template'; // section_id/group_id/field_id
/* Sender Detail */
$senderInfo = [
'name' => 'sender',
'email' => 'sender@domain.com'
];
/* Receiver Detail */
$receiverInfo = [
'name' => 'receiver',
'email' => 'receiver@domain.com'
];
/* To assign the values to template variables */
$customerDetails = array();
$customerDetails['name'] = 'John Doe';
$customerDetails['email'] = 'test@example.com';
$objectManager->get('VendorNameCustomModuleHelperEmailreport')->sendEmailReport(
$customEmailPath,
$senderInfo,
$receiverInfo,
$customerDetails = []
);
edited Jul 13 '17 at 4:00
answered Jul 12 '17 at 10:19
HarithaHaritha
386111
386111
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
|
show 2 more comments
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
what should we configure here----$customEmailPath = 'section_id/group_id/field_id';
– Raghu
Jul 12 '17 at 10:36
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
For instance if we need the email template format of new sales order email give 'sales_email/order/template' . This field can be identified from /vendor/magento/module-sales/etc/adminhtml/system.xml
– Haritha
Jul 12 '17 at 10:43
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
we have given the transactional email ID there directly
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
but we are getting this error Fatal error: Uncaught Error: Call to protected method NamespaceModulenameHelperEmailreport::sendEmailReport() from context '' in customtest.php:33 Stack trace: #0 main thrown in customtest.php on line 33
– Raghu
Jul 12 '17 at 10:47
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
Please check the updated code.
– Haritha
Jul 12 '17 at 11:57
|
show 2 more comments
I have created above two mentioned file. I have run file on root. I am getting null values in email template as below image.
New contributor
add a comment |
I have created above two mentioned file. I have run file on root. I am getting null values in email template as below image.
New contributor
add a comment |
I have created above two mentioned file. I have run file on root. I am getting null values in email template as below image.
New contributor
I have created above two mentioned file. I have run file on root. I am getting null values in email template as below image.
New contributor
New contributor
answered 7 mins ago
Dinesh RajputDinesh Rajput
1
1
New contributor
New contributor
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%2f183281%2fsend-transactional-email-from-root-folder-magento-2%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