Blame view

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

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

f0c912bf1   tmcdeveloper   add method tests ...
18
19
20
21
22
23
24
25
26
27
      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...
28
  };