Last active
July 3, 2017 08:23
-
-
Save chj1768/e92e50211d8061a09ecd77d26a4e7c8e to your computer and use it in GitHub Desktop.
send email with attachments using meteor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mailgun