fix(notifications): update ses to v2

this to prevent error message being thrown with nodemailer v7 from email
notifications. fixes #31457

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-10-17 12:10:25 +03:00
parent 99810880bd
commit 22a53624ec
4 changed files with 962 additions and 53 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-notifications-backend-module-email': patch
---
Updated `AWS SES` client to version 2 to support `nodemailer` version 7.
@@ -34,7 +34,7 @@
"test": "backstage-cli package test"
},
"dependencies": {
"@aws-sdk/client-ses": "^3.550.0",
"@aws-sdk/client-sesv2": "^3.911.0",
"@azure/communication-email": "^1.0.0",
"@azure/identity": "^4.0.0",
"@backstage/backend-plugin-api": "workspace:^",
@@ -14,7 +14,8 @@
* limitations under the License.
*/
import { createTransport } from 'nodemailer';
import { SendRawEmailCommand, SES } from '@aws-sdk/client-ses';
import { SendEmailCommand, SESv2Client } from '@aws-sdk/client-sesv2';
import { Config } from '@backstage/config';
import { AwsCredentialsManager } from '@backstage/integration-aws-node';
@@ -25,15 +26,17 @@ export const createSesTransport = async (
const credentials = await credentialsManager.getCredentialProvider({
accountId: config.getOptionalString('accountId'),
});
const ses = new SES([
const sesClient = new SESv2Client([
{
apiVersion: config.getOptionalString('apiVersion') ?? '2010-12-01',
credentials: credentials.sdkCredentialProvider,
apiVersion: config.getOptionalString('apiVersion'),
region: config.getOptionalString('region'),
credentials: credentials.sdkCredentialProvider,
endpoint: config.getOptionalString('endpoint'),
},
]);
return createTransport({
SES: { ses, aws: { SendRawEmailCommand } },
SES: { sesClient, SendEmailCommand },
});
};
+948 -47
View File
File diff suppressed because it is too large Load Diff