Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aomegax committed Jan 12, 2024
1 parent f904d96 commit 10485d9
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions integration-test/email/README.md
Original file line number Diff line number Diff line change
@@ -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`
5 changes: 5 additions & 0 deletions integration-test/email/config.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"accessKeyId": <YOUR_ACCESS_KEY_ID>,
"secretAccessKey": <YOUR_SECRET_ACCESS_KEY>,
"region": "eu-south-1"
}
49 changes: 49 additions & 0 deletions integration-test/email/ses_sendmail.js
Original file line number Diff line number Diff line change
@@ -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: [
'<CHANGE_ME>',
/* 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: '<CHANGE_ME>', /* 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);
});

0 comments on commit 10485d9

Please sign in to comment.