diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index feff08f0..cfb345c8 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -100,6 +100,8 @@ microservice-chart: OTEL_EXPORTER_OTLP_HEADERS: "elastic-apm-secret-token" SPRING_DATASOURCE_PASSWORD: "db-cfg-password" API_CONFIG_CACHE_API_KEY: "api-config-cache-subscription-key-string" + AWS_ACCESS_KEY_ID: "pagopa-aws-access-id" + AWS_SECRET_ACCESS_KEY: "pagopa-aws-secret-access-key" AWS_SES_USER: "standin-aws-ses-user" AWS_MAILTO: "standin-mail-to" COSMOS_KEY: "cosmos-standin-account-key" diff --git a/integration-test/email/README.md b/integration-test/email/README.md new file mode 100644 index 00000000..1d3d6573 --- /dev/null +++ b/integration-test/email/README.md @@ -0,0 +1,9 @@ +# Prerequisites +- `npm install aws-sdk` + +# Configuration +- Create `config.json` +- Set email address in the JS code + +# Run +- `node ses_sendmail.js` diff --git a/integration-test/email/config.json.example b/integration-test/email/config.json.example new file mode 100644 index 00000000..ac170a3c --- /dev/null +++ b/integration-test/email/config.json.example @@ -0,0 +1,5 @@ +{ + "accessKeyId": , + "secretAccessKey": , + "region": "eu-south-1" +} \ No newline at end of file diff --git a/integration-test/email/ses_sendmail.js b/integration-test/email/ses_sendmail.js new file mode 100644 index 00000000..3e9228ed --- /dev/null +++ b/integration-test/email/ses_sendmail.js @@ -0,0 +1,49 @@ +// Load the AWS SDK for Node.js +var AWS = require('aws-sdk'); + +AWS.config.loadFromPath('./config.json'); + +// Create sendEmail params +var params = { + Destination: { /* required */ + CcAddresses: [ + /* more items */ + ], + ToAddresses: [ + '', + /* more items */ + ] + }, + Message: { /* required */ + Body: { /* required */ + Html: { + Charset: "UTF-8", + Data: "HTML_FORMAT_BODY" + }, + Text: { + Charset: "UTF-8", + Data: "TEXT_FORMAT_BODY" + } + }, + Subject: { + Charset: 'UTF-8', + Data: 'Test email' + } + }, + Source: '', /* required */ + ReplyToAddresses: [ + /* more items */ + ], +}; + +// Create the promise and SES service object +var sendPromise = new AWS.SES({apiVersion: '2010-12-01'}).sendEmail(params).promise(); + +// Handle promise's fulfilled/rejected states +sendPromise.then( + function(data) { + console.log(data.MessageId); + }).catch( + function(err) { + console.error(err, err.stack); + }); \ No newline at end of file