Skip to content

Instantly share code, notes, and snippets.

@chj1768
Last active July 3, 2017 08:23
Show Gist options
  • Save chj1768/e92e50211d8061a09ecd77d26a4e7c8e to your computer and use it in GitHub Desktop.
Save chj1768/e92e50211d8061a09ecd77d26a4e7c8e to your computer and use it in GitHub Desktop.
send email with attachments using meteor.js
Meteor.methods({
sendMail( from, to, userName, attachments ) {
check( from, String );
check( to, String );
check( userName, String );
check( attachments, Array );
this.unblock();
const files = attachments.map( _ => { return { filename : 'filename', path : 'remote file url' }; } ); //example
Email.send( {
from : from,
to : to,
subject : 'title',
html : 'content html'
attachments : files
} );
}
});
@chj1768
Copy link
Author

chj1768 commented Jul 3, 2017

mailgun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment