verifyEmail.js 728 Bytes
import _                                  from 'lodash';
import { Accounts }                       from 'meteor/accounts-base';

Accounts.config({
  sendVerificationEmail: true
});

Accounts.emailTemplates.verifyEmail = {
  subject() {
    return '[YoungDesk] Verify Your Email Address';
  },
  text(user, url) {
    console.log(user);
    if(user.firstName){
      const name = user.firstName;
    }else{
      const name = user.profile.firstName;
    }
    const theUrl = Meteor.absoluteUrl(`back/verifyEmail/${_.last(url.split('/'))}`);

    return (
`
Hello, ${name}!


To verify your email address, visit the following link:

${theUrl}

If you did not request this verification, please ignore this email.

`
    );
  },
};