Created
December 24, 2017 01:21
-
-
Save SamWSoftware/c04984f8a69d64c807c1afbc4b959f85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MailgunMailer { | |
constructor({ subject, recipients }, content) { | |
this.data = { | |
from: "[email protected]", | |
to: this.formatAdresses(recipients), | |
subject: subject, | |
html: content | |
}; | |
} | |
formatAdresses(recipients) { | |
return recipients.map(({ email }) => email).join(","); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment