Skip to main content

某些 Mailgun 提供商的旧变量不受支持

🌐 Some Mailgun provider legacy variables are not supported

在 Strapi 5 中,不再支持 Mailgun 提供商在 Strapi v4 中弃用的一些旧变量。

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

此页面是重大更改数据库的一部分,提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 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

在 Strapi v4 中

Mailgun 提供商选项可以使用传统的 apiKeyhost 变量。

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

在 Strapi 5 中

Mailgun 提供商选项不能使用旧的 apiKeyhost 变量,必须改用 keyurl 变量。

🌐 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

在 Strapi 5 中,Mailgun 提供者插件配置文件 中的配置可以如下示例所示:

🌐 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. apiKey 重命名为 key
  2. host 重命名为 url,并在其前面添加 https://,以使其成为一个正确的 URL。