You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default Strapi provides a local email system ([sendmail](https://www.npmjs.com/package/sendmail)). If you want to use a third party to send emails, you need to install the correct provider module. Otherwise you can skip this part and continue to configure your provider.
70
70
71
-
You can check all the available providers developed by the community on npmjs.org - [Providers list](https://www.npmjs.com/search?q=strapi-provider-email-)
71
+
Below are the providers maintained by the Strapi team:
If your package name is [scoped](https://docs.npmjs.com/about-scopes) (for example `@username/strapi-provider-email-gmail-oauth2`) you need to take an extra step by aliasing it in `package.json`. Go to the `dependencies` section and change the provider line to look like this:
The string after the last `@` represents your desired [semver](https://docs.npmjs.com/about-semantic-versioning) version range.
100
-
101
99
### Configure your provider
102
100
103
-
After installing your provider you will need to add some settings in `config/plugins.js`. If this file doesn't exists, you'll need to create it. Check the README of each provider to know what configuration settings the provider needs.
101
+
After installing your provider you will need to add some settings in `./config/plugins.js`. If this file doesn't exists, you'll need to create it. Check the README of each provider to know what configuration settings the provider needs.
104
102
105
103
::: tip
106
104
Make sure you have the correct spelling of the configuration filename, it is written in plural (with a trailing 's'): `plugins.js`.
107
105
:::
108
106
109
-
Here is an example of a configuration made for the provider [strapi-provider-email-sendgrid](https://www.npmjs.com/package/strapi-provider-email-sendgrid).
107
+
Here is an example of a configuration made for the provider [@strapi/provider-email-sendgrid](https://www.npmjs.com/package/strapi-provider-email-sendgrid).
If you're using a different provider depending on your environment, you can specify the correct configuration in `config/env/${yourEnvironment}/plugins.js`. More info here: [Environments](http://localhost:8080/documentation/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md)
132
+
If you're using a different provider depending on your environment, you can specify the correct configuration in `./config/env/${yourEnvironment}/plugins.js`. More info here: [Environments](/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md)
133
133
:::
134
134
135
135
::: tip
@@ -143,8 +143,6 @@ More info here: [Configure templates Locally](/user-docs/latest/settings/configu
143
143
144
144
## Create new provider
145
145
146
-
If you want to create your own, make sure the name starts with `strapi-provider-email-` (duplicating an existing one will be easier) and customize the `send` function.
147
-
148
146
Default template
149
147
150
148
```js
@@ -157,6 +155,17 @@ module.exports = {
157
155
};
158
156
```
159
157
158
+
It is important that your provider's `package.json` includes the following object:
159
+
160
+
```json
161
+
{
162
+
// ...
163
+
"strapi": {
164
+
"isProvider": true
165
+
}
166
+
}
167
+
```
168
+
160
169
In the `send` function you will have access to:
161
170
162
171
-`providerOptions` that contains configurations written in `plugins.js`
@@ -170,7 +179,7 @@ To use it you will have to publish it on **npm**.
170
179
If you want to create your own provider without publishing it on **npm** you can follow these steps:
171
180
172
181
- Create a `providers` folder in your application.
173
-
- Create your provider as explained in the documentation eg.`./providers/strapi-provider-email-[...]/...`
182
+
- Create your provider (e.g.`./providers/strapi-provider-email-[...]/...`)
174
183
- Then update your `package.json` to link your `strapi-provider-email-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider.
0 commit comments