# Configure Alert trigger to publish to SNS topic and send custom message to different SNS protocols

**URL:** <https://forum.opensearch.org/t/configure-alert-trigger-to-publish-to-sns-topic-and-send-custom-message-to-different-sns-protocols/1468>\
**Category:** Alerting\
**Created:** [September 6, 2019, 2:07am UTC](https://forum.opensearch.org/t/configure-alert-trigger-to-publish-to-sns-topic-and-send-custom-message-to-different-sns-protocols/1468 "2019-09-06T02:07:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jberto78](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jberto78](https://forum.opensearch.org/u/jberto78)\
**Post date:** [September 6, 2019, 2:07am UTC](https://forum.opensearch.org/t/configure-alert-trigger-to-publish-to-sns-topic-and-send-custom-message-to-different-sns-protocols/1468/1 "2019-09-06T02:07:52Z")

</div>

Hello,  
I am needing to set up a trigger that calls an AWS SNS topic. The SNS topic will have two protocols (email and lambda). Is it possible to configure the message in the alert trigger so one custom message is sent to the e-mail protocol and another is sent to the lambda when calling the SNS topic?

I looked at the following documentation for guidance but I couldn’t find a proper solution for my issue.

> **[Publish -](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html)**
>
> Sends a message to an Amazon SNS topic, a text message (SMS message) directly to a phone number, or a message to a mobile platform endpoint (when you specify the TargetArn ).

I tried to use the following JSON in the message field of the trigger, it invokes the Lambda successfully and send the e-mail, however the e-mail has the entire JSON payload, not just the e-mail both (in this case just ‘test’). Is it possible to configure the message when calling the SNS topic so a customer text is sent to an e-mail group and another custom message sent to a Lambda?

{“default”: “Sample fallback message”,  
“email”:“Test”,  
“lambda”:“{"action": "TEST", "runbookURI": "URL","title":"[DEV] {{ctx.monitor.name}} (5 min)","text":"Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.","facts":[{"name":"Trigger","value":"{{ctx.trigger.name}}"},{"name":"Severity","value":"{{ctx.trigger.severity}}"},{"name":"count","value":"{{ctx.results.0.hits.total}}"},{"name":"Period Start","value":"{{ctx.periodStart}}"},{"name":"Period End","value":"{{ctx.periodEnd}}"}]}”  
}

---

<div class="post-metadata">

**Author:** ![ashisagr-amzn](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@ashisagr-amzn](https://forum.opensearch.org/u/ashisagr-amzn)\
**Post date:** [December 30, 2020, 8:16pm UTC](https://forum.opensearch.org/t/configure-alert-trigger-to-publish-to-sns-topic-and-send-custom-message-to-different-sns-protocols/1468/2 "2020-12-30T20:16:35Z")

</div>

Hi,

Sorry this functionality is not supported for the Alerting plugin. I recommend setting up 2 separate SNS topics, 1 for email and 1 for lambda. From there, you can configure what you want to send for each topic.

---

<div class="post-metadata">

**Author:** ![ashisagr-amzn](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@ashisagr-amzn](https://forum.opensearch.org/u/ashisagr-amzn)\
**Post date:** [December 30, 2020, 8:16pm UTC](https://forum.opensearch.org/t/configure-alert-trigger-to-publish-to-sns-topic-and-send-custom-message-to-different-sns-protocols/1468/3 "2020-12-30T20:16:47Z")

</div>

Closed on December 30, 2020, 8:16pm UTC


