We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a8dd6b commit fc56ea3Copy full SHA for fc56ea3
alertmanager/index.js
@@ -260,8 +260,17 @@ var apis = {
260
261
var record = unwrapDynamoDBTypedObject(event.Records[0].dynamodb.NewImage);
262
263
+ var messageText = record.subject + "\n\n" + record.details;
264
+ var messageByProtocol = {
265
+ default: messageText, // email etc.
266
+
267
+ // longer than 160 char SMS messages add up costs
268
+ sms: messageText.substr(0, 160 - 7) // -7 for "ALERT >" prefix in SMS messages
269
+ };
270
271
sns.publish({
- Message: record.subject + "\n\n" + record.details,
272
+ MessageStructure: 'json',
273
+ Message: JSON.stringify(messageByProtocol),
274
Subject: record.subject,
275
TopicArn: ALERT_TOPIC
276
}, function (err) {
0 commit comments