Meteor Email with Attachments


#1

I’ve updated my meteor to 1.2, and I’m now trying to use the new attachment feature with email, but not sure how to use it.

if(true == true){
  var dataAttachments = attachment;
  var dataText = 
  "Client Name: " + name + 
  "\rEmail: " + email + 
  "\rPhone: " + phone + 
  "\rCompany: " + company +
  "\rDeliverables: " + deliverables +
  "\rCopywriting: " + copywriting +
  "\rPrint Services: " + print +
  "\rIllustration: " + illustration +
  "\rphotography: " + photography + 
  "\rTimelines: " + timelines +
  "\rBudget: " + budget +
  "\rDescription: " + description;

  Meteor.call('sendEmail', dataText, dataAttachment);
  //throwAlert is my helper method which creates popup with message
  alert('Email sent');
}else{
  alert('An error occurred. Sorry');
  return false;
}
}

and

Meteor.methods({

     sendEmail: function (text) {
       check([text], [String]);

this.unblock();

Email.send({
  to: 'jaeeun@antarcti.cc',
  from: 'contact@myClientProject.com',
  subject: 'New message from contact form',
  text: text
});

Email.send().addAttachment(attachment);
}
});

#2

im on watch mode on this… i am not able to make this work too