primate icon indicating copy to clipboard operation
primate copied to clipboard

add `@primate/mail`

Open terrablue opened this issue 1 year ago • 1 comments

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, { ... });
  },
});

terrablue avatar Jun 20 '24 23:06 terrablue

should add Mailgun and SendGrid too. that's the one I use.

ralyodio avatar Jun 21 '24 01:06 ralyodio

https://github.com/primatejs/primate/issues/165

terrablue avatar Oct 14 '24 00:10 terrablue