Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accounts.emailTemplates is undefined

Tags:

meteor

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 
like image 611
Matanya Avatar asked Dec 03 '13 15:12

Matanya


1 Answers

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...

like image 85
Matanya Avatar answered Nov 16 '22 01:11

Matanya