Reputation: 1816
I have a contact us service which is triggered by users from a website.
Whenever user sends message, an email is sent to admin to notify about new contact. This email is in the form a json given below,
Is there a way to have it as a formatted email? I have figured out one method that is write a lambda to trigger SES. Is there a better method?
Upvotes: 2
Views: 9673
Reputation: 1230
When SNS sends an email, it sends the entire notification and not just the message attribute. You cannot format message or only send some of the attributes.
Your message is in JSON format, have you tried the subscription protocol "Email" instead of "Email-JSON"? It should give the same result but just in clear text. I dont know if that will help your situation.
An alternative would be to send the notifications to Lambda which can then send a formattet email via SES. You can either send the messages directly to Lambda, or via a SQS for resilience (see this discussion).
Upvotes: 5