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 中

¥In Strapi v4

Mailgun 提供程序选项可以使用旧版 apiKeyhost 变量。

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

在 Strapi 5 中

¥In 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

插件配置文件 中的 Mailgun 提供程序配置在 Strapi 5 中可能看起来像以下示例:

¥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

    ¥Rename apiKey to key.

  2. 删除 host 突变以支持能够从主 url 突变更新任何语言环境

    ¥Rename host to url and add https:// in front of it so it is a proper URL.