Here's my code in imports/api/friends/methods.js
:
import {Meteor} from "meteor/meteor";
import {Accounts} from "meteor/accounts-base";
if (Meteor.isServer) {
Accounts.emailTemplates.siteName = "....";
Accounts.emailTemplates.from = "example01 <[email protected]>";
Accounts.emailTemplates.verifyEmail.from = function () {
return "example01 <[email protected]>";
};
Accounts.emailTemplates.verifyEmail.text = function(user, url) {
return '<h1>Thank you for your registration.</h1><br/><a href="' + url + '">Verify eMail</a>';
};
}
And this is the result:
As you can see, the format is ingnored by Gmail. We can se the HTML tags <h1>
and <br>
.
Why are they not display as HTML?
You used the wrong function. If you use
Accounts.emailTemplates.verifyEmail.text
, the body will be returned as text and not as HTML. So instead, you should useAccounts.emailTemplates.verifyEmail.html
.For example:
Read more about
Accounts.emailTemplates
.