primate
primate copied to clipboard
add `@primate/mail`
In a store file, say stores/Mailchimp.js:
import mail from "@primate/mail";
import env from "rcompat/env";
export default mail({
provider: "mailchimp",
secret: env.MAILCHIMP_API_KEY,
options: {
server: env.MAILCHIMP_SERVER_PREFIX,
},
});
Then in a route, say routes/register.js:
export default {
post(request) {
// Handle registration
/* ... */
// send email
request.store.Mailchimp.send(user.email, { ... });
},
});
should add Mailgun and SendGrid too. that's the one I use.
https://github.com/primatejs/primate/issues/165