Matanya
Matanya

Reputation: 6346

Accounts.emailTemplates is undefined

Following the docs here, I'm trying to set the content of the resetPassword email template but I keep getting undefined.

When I inspect the Accounts object in the console, I see that indeed it doesn't have an emailTemplates property.

Code:

Accounts.emailTemplates.resetPassword.text = function(user, url) {
      url = url.replace('#/', '');
      return "Click this link to reset your password: " + url;
 }   

Error:

Uncaught TypeError: Cannot read property 'resetPassword' of undefined 

Upvotes: 8

Views: 1533

Answers (1)

Matanya
Matanya

Reputation: 6346

I ended up putting the code in the server directory, and then it worked flawlessly. What baffles me is that the docs state this property is to be used Anywhere...

Upvotes: 12

Related Questions