Skip to content

Instantly share code, notes, and snippets.

@shaina7837
Last active November 24, 2016 03:51
Show Gist options
  • Save shaina7837/52ad8a8169e8a6365c56c756486f7ea3 to your computer and use it in GitHub Desktop.
Save shaina7837/52ad8a8169e8a6365c56c756486f7ea3 to your computer and use it in GitHub Desktop.
let email = i.emailIds.get();
email = email.map(item => {
let formData = Form.process(i.$("form[name="+item._id+"]"));
let invite_id = item._id;
let invite_url = Meteor.absoluteUrl() + 'testAccepted/' + invite_id;
BT.collections.invites.insert({"sender":currentUser, "receiver":formData.emailsid, "test_id":test_id ,"expiry_date":expiry_date ,"invite_id":invite_id ,"invite_url":invite_url, "otp":otp, invite_accepted: false});
return {emails:formData.emailsId, inviteId: invite_id};
});
let url = Meteor.absoluteUrl() + 'testAccepted/' + email.inviteId;
console.log(email.emails);
Meteor.call('sendMail', email.emails, url, otp, function(error){
if(error) console.log("ERROR", error);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment