SendGrid and setting different headers for different purposes (verify, forgot password, etc)


Here’s what I’m trying to accomplish:

I want to define different templates in SendGrid, and use each one based on what email from Meteor is being sent out (verification, reset password). The problem is, you set the template and its substitution vars in the header, and it looks like we only get one header object:

Accounts.emailTemplates.headers = ...

Is there some other way to accomplish this? It would be great if we had a headers property on Accounts.emailTemplates.verifyEmail and its counterparts.

If I can’t find a solution for this, it means I’ll have to design my HTML emails by hand (complete pain) and then paste that into Meteor.


Does it just make sense to maybe change Accounts.emailTemplates.headers right before sending a reset password email, verify account email, etc? Seems hacky, but I’m assuming this would work.


Yes it will work. What I’ve basically used is SendGrid’s X-SMTPAPI header and filling in the necessary fields to call the right template for sending out the email.