Send transactional email from root folder magento 2Magento2 get email templates dropdown in stores...
Would a high gravity rocky planet be guaranteed to have an atmosphere?
Flow chart document symbol
How to pronounce the slash sign
A Rare Riley Riddle
How do I extract a value from a time formatted value in excel?
Customer Requests (Sometimes) Drive Me Bonkers!
What is the difference between "behavior" and "behaviour"?
Replace character with another only if repeated and not part of a word
What does 算不上 mean in 算不上太美好的日子?
Go Pregnant or Go Home
How does the UK government determine the size of a mandate?
Is the destination of a commercial flight important for the pilot?
Large drywall patch supports
What can we do to stop prior company from asking us questions?
Is HostGator storing my password in plaintext?
Is there a good way to store credentials outside of a password manager?
Was Spock the First Vulcan in Starfleet?
Escape a backup date in a file name
How can I quit an app using Terminal?
Is exact Kanji stroke length important?
India just shot down a satellite from the ground. At what altitude range is the resulting debris field?
Valid Badminton Score?
Would this custom Sorcerer variant that can only learn any verbal-component-only spell be unbalanced?
Is a stroke of luck acceptable after a series of unfavorable events?
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 16 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