Getting HTML of transactional emailsFormatting transactional emailsSending out transactional emails manuallyWYSIWYG editor for transactional emailsSome transactional emails are not being sentCan't send emailsBASE64_LENGTH_79_INF: SpamAssasin penalizes transactional emailsOverriding Core File in MagentoMagento 2 Sending emails triggered by observerTransactional emails: centering an imageTransactional Emails not sending
Where is Jon going?
How was Daenerys able to legitimise Gendry?
Is keeping the forking link on a true fork necessary (Github/GPL)?
Apart from the sine wave, are there any other waveshapes that could be thought of as commonly appearing "in nature"?
Job Market: should one hide their (young) age?
Grade-school elementary algebra presented in an abstract-algebra style?
How would a developer who mostly fixed bugs for years at a company call out their contributions in their CV?
What weight should be given to writers groups critiques?
Natural Armour and Weapons
Can a tabaxi rogue with the Criminal background start with 8 skill proficiencies?
Freedom of Speech and Assembly in China
Why isn't Tyrion mentioned in the in-universe book "A Song of Ice and Fire"?
What is the use case for non-breathable waterproof pants?
Is my plasma cannon concept viable?
Dad jokes are fun
What are nvme namespaces? How do they work?
Can a ring of spell storing and access to Find spells produce an endless menagerie?
Writing style before Elements of Style
Need to read my home electrical Meter
What does it mean when a vocal teacher tell you that your lowest notes are heavy?
First Program Tic-Tac-Toe
Would Buddhists help non-Buddhists continuing their attachments?
Time complexity of an algorithm: Is it important to state the base of the logarithm?
What tokens are in the end of line?
Getting HTML of transactional emails
Formatting transactional emailsSending out transactional emails manuallyWYSIWYG editor for transactional emailsSome transactional emails are not being sentCan't send emailsBASE64_LENGTH_79_INF: SpamAssasin penalizes transactional emailsOverriding Core File in MagentoMagento 2 Sending emails triggered by observerTransactional emails: centering an imageTransactional Emails not sending
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like to know if it's possible to get code html of transactional emails before send email to user with template variables etc. I overrided _sendEmailTemplate and I try to get html code in this way:
protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($this->getEmail(), $this->getName());
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
$mailer->setTemplateParams($templateParams);
$emailTemplate = Mage::getModel('core/email_template')->loadByCode($template); // I try to get template
$processedTemplate = $emailTemplate->getProcessedTemplate($templateParams); //set template variables and get html code
print_R($processedTemplate);
exit;
$mailer->send();
return $this;
Comments in code.
It doesn't work. Any ideas will be appreciated
magento-1.9 email html
add a comment |
I would like to know if it's possible to get code html of transactional emails before send email to user with template variables etc. I overrided _sendEmailTemplate and I try to get html code in this way:
protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($this->getEmail(), $this->getName());
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
$mailer->setTemplateParams($templateParams);
$emailTemplate = Mage::getModel('core/email_template')->loadByCode($template); // I try to get template
$processedTemplate = $emailTemplate->getProcessedTemplate($templateParams); //set template variables and get html code
print_R($processedTemplate);
exit;
$mailer->send();
return $this;
Comments in code.
It doesn't work. Any ideas will be appreciated
magento-1.9 email html
app/code/core/Mage/Core/Model/Email/Template.php
Check send function there you can echo html of email and you can save it
– Rohit Kundale
Jan 13 '16 at 10:02
add a comment |
I would like to know if it's possible to get code html of transactional emails before send email to user with template variables etc. I overrided _sendEmailTemplate and I try to get html code in this way:
protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($this->getEmail(), $this->getName());
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
$mailer->setTemplateParams($templateParams);
$emailTemplate = Mage::getModel('core/email_template')->loadByCode($template); // I try to get template
$processedTemplate = $emailTemplate->getProcessedTemplate($templateParams); //set template variables and get html code
print_R($processedTemplate);
exit;
$mailer->send();
return $this;
Comments in code.
It doesn't work. Any ideas will be appreciated
magento-1.9 email html
I would like to know if it's possible to get code html of transactional emails before send email to user with template variables etc. I overrided _sendEmailTemplate and I try to get html code in this way:
protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($this->getEmail(), $this->getName());
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
$mailer->setTemplateParams($templateParams);
$emailTemplate = Mage::getModel('core/email_template')->loadByCode($template); // I try to get template
$processedTemplate = $emailTemplate->getProcessedTemplate($templateParams); //set template variables and get html code
print_R($processedTemplate);
exit;
$mailer->send();
return $this;
Comments in code.
It doesn't work. Any ideas will be appreciated
magento-1.9 email html
magento-1.9 email html
edited Nov 2 '18 at 23:05
sv3n
10.1k62557
10.1k62557
asked Jan 13 '16 at 9:57
coreycorey
416
416
app/code/core/Mage/Core/Model/Email/Template.php
Check send function there you can echo html of email and you can save it
– Rohit Kundale
Jan 13 '16 at 10:02
add a comment |
app/code/core/Mage/Core/Model/Email/Template.php
Check send function there you can echo html of email and you can save it
– Rohit Kundale
Jan 13 '16 at 10:02
app/code/core/Mage/Core/Model/Email/Template.php
Check send function there you can echo html of email and you can save it– Rohit Kundale
Jan 13 '16 at 10:02
app/code/core/Mage/Core/Model/Email/Template.php
Check send function there you can echo html of email and you can save it– Rohit Kundale
Jan 13 '16 at 10:02
add a comment |
2 Answers
2
active
oldest
votes
It depends on what you want to do with the HTML code, but what I used to do to debug emails is log the email HTML code into a file.
Instead of using print_r, you can do:
Mage::log($processedTemplate, null, sprintf("email_%s.html", date("Ymd-his")));
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
add a comment |
Have you considered installing an extension such as this
https://www.yireo.com/software/magento-extensions/emailtester
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%2f97003%2fgetting-html-of-transactional-emails%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
It depends on what you want to do with the HTML code, but what I used to do to debug emails is log the email HTML code into a file.
Instead of using print_r, you can do:
Mage::log($processedTemplate, null, sprintf("email_%s.html", date("Ymd-his")));
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
add a comment |
It depends on what you want to do with the HTML code, but what I used to do to debug emails is log the email HTML code into a file.
Instead of using print_r, you can do:
Mage::log($processedTemplate, null, sprintf("email_%s.html", date("Ymd-his")));
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
add a comment |
It depends on what you want to do with the HTML code, but what I used to do to debug emails is log the email HTML code into a file.
Instead of using print_r, you can do:
Mage::log($processedTemplate, null, sprintf("email_%s.html", date("Ymd-his")));
It depends on what you want to do with the HTML code, but what I used to do to debug emails is log the email HTML code into a file.
Instead of using print_r, you can do:
Mage::log($processedTemplate, null, sprintf("email_%s.html", date("Ymd-his")));
answered Jan 13 '16 at 10:01
Raphael at Digital PianismRaphael at Digital Pianism
55.7k22126286
55.7k22126286
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
add a comment |
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
I want to save content of all HTML code in file on my harddisk for example :)
– corey
Jan 13 '16 at 10:02
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
The $processedTemplate variable contains the HTML of the email, from that point you can do whatever you want with it, just ensure your email is still being sent after you wrote your code.
– Raphael at Digital Pianism
Jan 13 '16 at 10:12
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
However I execute your Mage::log after send email, I can't get properly my HTML code, I don't know why because I check new email_2016-0113-101610.html and it's doesn't contain nothing instead of DEBUG and it's all. I don't get HTML code.
– corey
Jan 13 '16 at 10:18
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
Ok, I got it. It was simple: $mailer->getProcessedTemplate($templateVariables) instead of create new variable $emailTemplate
– corey
Jan 13 '16 at 10:26
add a comment |
Have you considered installing an extension such as this
https://www.yireo.com/software/magento-extensions/emailtester
add a comment |
Have you considered installing an extension such as this
https://www.yireo.com/software/magento-extensions/emailtester
add a comment |
Have you considered installing an extension such as this
https://www.yireo.com/software/magento-extensions/emailtester
Have you considered installing an extension such as this
https://www.yireo.com/software/magento-extensions/emailtester
answered May 16 at 21:36
Dominic XigenDominic Xigen
39810
39810
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%2f97003%2fgetting-html-of-transactional-emails%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
app/code/core/Mage/Core/Model/Email/Template.php
Check send function there you can echo html of email and you can save it– Rohit Kundale
Jan 13 '16 at 10:02