Skip to content

Commit aabcd5e

Browse files
Add information & configuration example in Email feature page (#2801)
* Add info callout + config example in Email feature page * Improve after feedback
1 parent 8906f9b commit aabcd5e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docusaurus/docs/cms/features/email.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ The Email feature enables Strapi applications to send emails from a server or an
3131

3232
Most configuration options for the Email feature are handled via your Strapi project's code. The Email feature is not configurable in the admin panel, however users can test email delivery if it has been setup by an administrator.
3333

34+
:::info Provider vs. Host
35+
- The email provider refers to the package that Strapi calls to send an email (e.g. official providers such as Sendgrid or community packages such as `@strapi/provider-email-nodemailer`). Providers implement the logic for sending mail when Strapi invokes them.
36+
- The provider host (or server) refers to the connection details (e.g. an SMTP hostname, port, or REST API endpoint) that the provider exposes. Some providers hide these details behind an API key, while others require you to supply host-related options in your configuration.
37+
38+
The Email feature only handles outbound delivery. Receiving or parsing incoming messages is outside the scope of the built-in plugin and must be implemented with your email provider's inbound webhooks or a custom integration.
39+
:::
40+
3441
### Admin panel settings
3542

3643
**Path to configure the feature:** <Icon name="gear-six" /> Settings > Email feature > Configuration
@@ -196,6 +203,33 @@ When configuring your provider you might want to change the configuration based
196203

197204
You can set a specific configuration in the `/config/env/{env}/plugins.js|ts` configuration file and it will be used to overwrite the default configuration.
198205

206+
Some providers expose SMTP-style connection details instead of (or in addition to) an API key. Add those values in `providerOptions` so Strapi can reach the provider host. For instance, the community Nodemailer provider expects the host, port, and authentication credentials:
207+
208+
```js title="/config/plugins.js"
209+
module.exports = ({ env }) => ({
210+
email: {
211+
config: {
212+
provider: 'nodemailer',
213+
providerOptions: {
214+
host: env('SMTP_HOST'),
215+
port: env.int('SMTP_PORT', 587),
216+
secure: false, // Use `true` for port 465
217+
auth: {
218+
user: env('SMTP_USERNAME'),
219+
pass: env('SMTP_PASSWORD'),
220+
},
221+
},
222+
settings: {
223+
defaultFrom: 'no-reply@example.com',
224+
defaultReplyTo: 'support@example.com',
225+
},
226+
},
227+
},
228+
});
229+
```
230+
231+
If your provider gives you a single URL instead of host and port values, pass that URL (for example `https://api.eu.mailgun.net`) in `providerOptions` using the key the package expects.
232+
199233
##### Creating providers
200234

201235
To implement your own custom provider you must <ExternalLink to="https://docs.npmjs.com/creating-node-js-modules" text="create a Node.js module"/>.

0 commit comments

Comments
 (0)