🐛 Fixed email type when creating Members via API

refs https://github.com/TryGhost/Team/issues/1197

We were always sending the 'signin' email, rather than respecting the
email_type param passed to the API. This updates our email sending when
creating members to force the requested type if it's present.
This commit is contained in:
Fabien O'Carroll 2021-11-02 12:56:00 +02:00
parent b690fce219
commit c45afc7f26
3 changed files with 10 additions and 6 deletions

View File

@ -154,7 +154,11 @@ module.exports = {
}
if (frame.options.send_email) {
await membersService.api.sendEmailWithMagicLink({email: member.get('email'), requestedType: frame.options.email_type});
await membersService.api.sendEmailWithMagicLink({
email: member.get('email'), requestedType: frame.options.email_type, options: {
forceEmailType: true
}
});
}
return member;

View File

@ -79,7 +79,7 @@
"@tryghost/limit-service": "0.6.5",
"@tryghost/logging": "1.0.0",
"@tryghost/magic-link": "1.0.14",
"@tryghost/members-api": "2.6.0",
"@tryghost/members-api": "2.6.1",
"@tryghost/members-csv": "1.1.8",
"@tryghost/members-importer": "0.3.4",
"@tryghost/members-offers": "0.10.1",

View File

@ -1513,10 +1513,10 @@
"@tryghost/domain-events" "^0.1.3"
"@tryghost/member-events" "^0.3.1"
"@tryghost/members-api@2.6.0":
version "2.6.0"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-2.6.0.tgz#910398f53d0b13088982440d4a961a9d01566708"
integrity sha512-xVZr62kQJozOm4BMVboaweMJMXnmUhtLHgnLAmBZzyk62JViv7n6czp8frn/FZkBLWqyijNHxfhcmueOX0tJcg==
"@tryghost/members-api@2.6.1":
version "2.6.1"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-2.6.1.tgz#6620fe7bf0d28ac433292a534fe651e20f9c3a6a"
integrity sha512-GKVjS8EVnMC7AsB6J1Ku7TfcSsuQtdPuDy+PKw2aJQbDxIUo4pZf/fIlGMyusABpe4Twz65JVV/B4lk4VykFwQ==
dependencies:
"@tryghost/debug" "^0.1.2"
"@tryghost/domain-events" "^0.1.3"