Blame view

imports/startup/server/accounts/email-templates.js 773 Bytes
f0c912bf1   tmcdeveloper   add method tests ...
1
2
3
4
  const name = 'Application Name';
  const email = '<support@application.com>';
  const from = `${name} ${email}`;
  const emailTemplates = Accounts.emailTemplates;
c39994410   Ryan Glover   wip converting to...
5

7df77f0fa   tmcdeveloper   finish wiring up ...
6
  emailTemplates.siteName = name;
f0c912bf1   tmcdeveloper   add method tests ...
7
  emailTemplates.from = from;
c39994410   Ryan Glover   wip converting to...
8
9
10
  
  emailTemplates.resetPassword = {
    subject() {
f0c912bf1   tmcdeveloper   add method tests ...
11
      return `[${name}] Reset Your Password`;
c39994410   Ryan Glover   wip converting to...
12
    },
f0c912bf1   tmcdeveloper   add method tests ...
13
14
15
    text(user, url) {
      const userEmail = user.emails[0].address;
      const urlWithoutHash = url.replace('#/', '');
c39994410   Ryan Glover   wip converting to...
16

f0c912bf1   tmcdeveloper   add method tests ...
17
18
19
20
21
22
23
24
25
26
      return `A password reset has been requested for the account related to this
      address (${userEmail}). To reset the password, visit the following link:
      
  
  ${urlWithoutHash}
  
   If you did not request this reset, please ignore
      this email. If you feel something is wrong, please contact our support team:
      ${email}.`;
    },
c39994410   Ryan Glover   wip converting to...
27
  };