Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ijsto/strapi-provider-email-mailjet
Strapi Email service provider for Mailjet
https://github.com/ijsto/strapi-provider-email-mailjet
Last synced: 10 days ago
JSON representation
Strapi Email service provider for Mailjet
- Host: GitHub
- URL: https://github.com/ijsto/strapi-provider-email-mailjet
- Owner: ijsto
- License: mit
- Created: 2020-08-20T18:55:35.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-01T16:38:04.000Z (over 2 years ago)
- Last Synced: 2024-05-21T23:44:12.038Z (6 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 11
- Watchers: 2
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# strapi-provider-email-mailjet
[Strapi](http://strapi.io/) email service for [Mailjet](https://mailjet.com/)
# Prerequisites
You will need to have the plugin `strapi-plugin-email` installed in you Strapi project.
# Installation
```
# using yarn
yarn add strapi-provider-email-mailjet# using npm
npm i strapi-provider-email-mailjet
```# Configuration
| Variable | Type | Description | Required | Default |
| ---------------------------- | ------ | --------------------------------------------------------------------------------------------- | -------- | --------- |
| provider | string | The name of the provider you use | yes | |
| providerOptions | object | Provider options | yes | |
| providerOptions.publicApiKey | string | Mailjet public API key. See your [MailJet API keys](https://app.mailjet.com/account/api_keys) | yes | |
| providerOptions.secretApiKey | string | Mailjet secret API key. See your [MailJet API keys](https://app.mailjet.com/account/api_keys) | yes | |
| settings | object | Settings | no | {} |
| settings.defaultFrom | string | Default sender mail address | yes | undefined |
| settings.defaultFromName | string | Default sender name | yes | undefined |
| settings.defaultTo | string | Default receiver mail address | yes | undefined |
| settings.defaultToName | string | Default receiver name | yes | undefined |### Example config file
Path - `config/plugins.js`
```javascript
module.exports = ({ env }) => ({
// ...
email: {
config: {
provider: "strapi-provider-email-mailjet",
providerOptions: {
publicApiKey: env("MAILJET_PUBLIC_KEY"),
secretApiKey: env("MAILJET_SECRET_KEY"),
},
settings: {
defaultFrom: "[email protected]",
defaultFromName: "Scott from iJS.to",
defaultTo: "[email protected]",
defaultToName: "Johnny Bravodoe",
},
},
// ...
}
});
```# API
Strapi Mailjet Plugin enables you to interact with Mailjet API via custom methods listed below.
This API is a subset of the [MailJet API](https://dev.mailjet.com/email/reference/).
## Sending API
You can easily send emails via
### Usage example
**Single recipient**
```javascript
await strapi.plugins.email.services.email.send({
to: "[email protected]",
toName: "Scott Agirs",
subject: "👋 Hey there!",
text: `Text version of your email`,
html: `