Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can Magento allow for custom header information in Transaction Emails? 
 
ci3partners
Jr. Member
 
Total Posts:  20
Joined:  2010-02-21
 

We are using SendGrid for our transaction emails.
SendGrid allows for a number of header tags to enable tracking and categorization of emails that flow through their system.

I am trying to add a header tag to an email template:

X-SMTPAPI: {"category": “New Account"}

Not having any success.

It appears Magento populates the transactional email headers on its own (they cannot be edited, and if so, would be a edit for all transactional email not just the template you are using).

Does anyone have any insight on this.  I have spent 2 hours researching and literally can find nothing on the subject.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

By email header do you meant the Subject line?

If yes and you didn’t create custom email template from System >Transactional Emails, simple go to the email template file via FTP, and edit the very first line, e.g.

<!--@subject Welcome, {{var customer.name}}! @-->

Just make sure you don’t change anything wrapped in {{ }}.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ci3partners
Jr. Member
 
Total Posts:  20
Joined:  2010-02-21
 

Thank you for your reply -

No, we are trying to embed a tag in the header (so it does not show up in the visible portion of the mail).
The magento templates only seem to define the Body of the email (other than the subject line)…
I agree that if you can define the subject in the template, you should also be able to define other heading tags as well.

I tried enclosing in similar tags to the Subject Header tag, but no luck.

Any other thoughts?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
fstrube
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2010-10-04
Alexandria, VA
 

You would have to override the core mail template models to parse any additional tags in your transactional emails.

Check out the loadDefault() function in the core/email_template model (app/code/core/Mage/Core/Model/Email/Template.php, line 128). This is where it is parsing the HTML comments in your template file.

A custom module could override this function to parse an additional “@headers” tag, and later use it when sending the emails.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top