Skip to main content

Some Mailgun provider legacy variables are not supported

In Strapi 5, the support is dropped for some legacy variables deprecated in Strapi v4 for the Mailgun provider.

This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

🔌 Is this breaking change affecting plugins?Yes
🤖 Is this breaking change automatically handled by a codemod?No

Breaking change description

In Strapi v4

Mailgun provider options can use the legacy apiKey and host variables.

In Strapi 5

Mailgun provider options can not use the legacy apiKey and host variables and must use the key and url variables instead.

Migration

This section regroups useful notes and procedures about the introduced breaking change.

Notes

A Mailgun provider configuration in the plugins configuration file could look like the following example in Strapi 5:

/config/plugins.js
module.exports = ({ env }) => ({
// ...
email: {
config: {
provider: 'mailgun',
providerOptions: {
key: env('MAILGUN_API_KEY'), // Required
domain: env('MAILGUN_DOMAIN'), // Required
url: env('MAILGUN_URL', 'https://api.mailgun.net'), //Optional. If domain region is Europe use 'https://api.eu.mailgun.net'
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
},
},
// ...
});

Manual procedure

If you were using the legacy parameters:

  1. Rename apiKey to key.
  2. Rename host to url and add https:// in front of it so it is a proper URL.