Blame view

imports/server/emails/verifyEmail.js 785 Bytes
ff976df49   Deepak   added orgs public...
1
2
  import _                                  from 'lodash';
  import { Accounts }                       from 'meteor/accounts-base';
878ca8a15   Deepak   added signup form...
3
  import { Orgs }                           from '/imports/collections/orgs/index';
ff976df49   Deepak   added orgs public...
4
5
6
7
8
9
10
  
  Accounts.config({
    sendVerificationEmail: true
  });
  
  Accounts.emailTemplates.verifyEmail = {
    subject() {
b7054c9b2   Deepak   added specific or...
11
      return '[YoungDesk] Verify Your Email Address';
ff976df49   Deepak   added orgs public...
12
13
14
    },
    text(user, url) {
      const theUrl = Meteor.absoluteUrl(`back/verifyEmail/${_.last(url.split('/'))}`);
878ca8a15   Deepak   added signup form...
15
      org = Orgs.findOne({"_id":user.orgId});
ff976df49   Deepak   added orgs public...
16

878ca8a15   Deepak   added signup form...
17
      OrgUrl = theUrl.replace("http://","http://"+org.slug+".");
ff976df49   Deepak   added orgs public...
18
19
      return (
  `
878ca8a15   Deepak   added signup form...
20
  Hello, ${user.firstName}!
ff976df49   Deepak   added orgs public...
21
22
23
  
  
  To verify your email address, visit the following link:
878ca8a15   Deepak   added signup form...
24
  ${OrgUrl}
ff976df49   Deepak   added orgs public...
25
26
27
28
29
30
31
  
  If you did not request this verification, please ignore this email.
  
  `
      );
    },
  };