Tevin Thuku Tevin Thuku - 3 months ago 26
Javascript Question

Customize Forgot Password Email .Meteorjs

This function below works just fine. But How do I change the sender parameters of the forgot password email.

sendForgotpasswordmail() {
let options = {};
options.email = this.state.email;
Accounts.forgotPassword(options, function(error){

if (error) {
console.log(error);
}else{
alert('Check your mailbox!');
}
});
}


Whenever I send that I get the sender as
From: "Meteor Accounts" <no-reply@meteor.com>
and that is what I want to change

Answer

You should be able to change this by adding the following:

Accounts.emailTemplates.resetPassword.from = function () {
   // Overrides value set in Accounts.emailTemplates.from when resetting passwords
   return "AwesomeSite Password Reset <no-reply@example.com>";
};

Further explained in the docs:
http://docs.meteor.com/api/passwords.html#Accounts-emailTemplates

Comments