Blame view
imports/server/emails/verifyEmail.js
796 Bytes
ff976df49
|
1 2 |
import _ from 'lodash'; import { Accounts } from 'meteor/accounts-base'; |
878ca8a15
|
3 |
import { Orgs } from '/imports/collections/orgs/index'; |
ff976df49
|
4 5 6 7 8 9 10 |
Accounts.config({ sendVerificationEmail: true }); Accounts.emailTemplates.verifyEmail = { subject() { |
b7054c9b2
|
11 |
return '[YoungDesk] Verify Your Email Address'; |
ff976df49
|
12 13 14 |
}, text(user, url) { const theUrl = Meteor.absoluteUrl(`back/verifyEmail/${_.last(url.split('/'))}`); |
878ca8a15
|
15 |
org = Orgs.findOne({"_id":user.orgId}); |
ff976df49
|
16 |
|
316564385
|
17 |
OrgUrl = encodeURI(theUrl.replace("http://","http://"+org.slug+".")); |
ff976df49
|
18 19 |
return ( ` |
878ca8a15
|
20 |
Hello, ${user.firstName}! |
ff976df49
|
21 22 23 |
To verify your email address, visit the following link: |
878ca8a15
|
24 |
${OrgUrl} |
ff976df49
|
25 26 27 28 29 30 31 |
If you did not request this verification, please ignore this email. ` ); }, }; |