Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add @primate/mail #133

Open
terrablue opened this issue Jun 20, 2024 · 1 comment
Open

add @primate/mail #133

terrablue opened this issue Jun 20, 2024 · 1 comment
Labels
modules modules / ecosystem

Comments

@terrablue
Copy link
Contributor

terrablue commented Jun 20, 2024

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 terrablue added the modules modules / ecosystem label Jun 20, 2024
@terrablue terrablue mentioned this issue Jun 20, 2024
@terrablue terrablue changed the title create @primate/mailer create @primate/mail Jun 20, 2024
@ralyodio
Copy link
Contributor

ralyodio commented Jun 21, 2024

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

@terrablue terrablue changed the title create @primate/mail add @primate/mail Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules modules / ecosystem
Projects
None yet
Development

No branches or pull requests

2 participants