aws sns sms usage reports, able to save message body? - amazon-web-services

I now that we can set up SNS service SMS subscription which would save the MessageId and few other info.
At first, I thought it would also save the messages too but while reading the records, it is not included.
Is there a way to include it or it's just something we have to do manually while sending the sms?
Thanks in advance for any help.

The message content is not part of your delivery receipt metadata, so it's a good practice that you do your own book-keeping and track all the messages you've sent. A sample schema could be something like:
Destination Phone Number (e.g. +12065551234)
ISO Country Code (e.g. US)
Sent Date (epoch)
Message Id (auto-generated from request)
MCCMNC carrier information
Message Content
Then you can store all this data in a data storage of your choice.
An example architecture (that is cost efficient for high traffic) could be:
Create metadata POJO and serialize into JSON
Use Kinesis Firehose to stream/batch your serialized metadata into S3
Use AWS Glue to determine the schema of your S3 objects
Use AWS Athena to query your stored S3 data
You can read the documentation on how to setup CloudWatch to store metrics and logs for SMS deliveries here
Another recommendation is to check your SMS usage reports. Here is the documentation for that.
Best of luck.
Disclosure: I work in AWS and I worked in the Mobile Messaging (SMS/Push) team.

Related

Can we save client SMS responses in AWS Pinpoint's 2-way SMS?

I know that Amazon Pinpoint enables 2-way SMS, but I was wondering whether it was possible to save the message that the client sends. I'm finding myself going down the AWS rabbit-hole a bit, but I was wondering if anyone has any recommendations as to what AWS services could hold onto response data.
Just to clarify, I understand that Pinpoint allows us to return automated messages when the client passes a keyword. I am also aware that we can create user segments to save user attributes, I am moreso inquiring whether there is a way to stream user responses (that are not keywords) to another service or topic. Thank you!
An overview of Amazon Pinpoint two-way messaging can be summarized as per the above sample architecture.
You can capture the incoming messages from your users using the SNS topic you would have created when activating Pinpoint two-way messaging i.e When your users reply to your SMS message using the long code number, Amazon Pinpoint sends a JSON payload to the Amazon SNS topic that you designated. As a developer you handle these incoming messages by adding subscriptions to this SNS topic. The supported subscriptions include SQS, Lambda, email, HTTPS endpoint or SMS.
A sample JSON payload that your SNS topic subscriptions would receive would resemble the following :
{
"originationNumber":"+27155550000",
"destinationNumber":"+2722255511111",
"messageKeyword":"START",
"messageBody":"Hello World from Amazon Pinpoint",
"inboundMessageId":"cae173d2-66b9-564c-8309-66b9",
"previousPublishedMessageId":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
Hope this Helps!

How to send database report as csv sheet to an email?

I am needing to export some data from DynamoDB or Postgres as a csv and send that file to an email every month. Is there a scheduler I can set up that will do this for me? Or will I need to create a lambda function to export data and send the email every month?
To automate this as much as possible, your best bet is writing a lambda.
You can setup a recurring monthly event trigger using CloudWatch Events that will remove the need to manually kick things off.
Inside the lambda, your code would query the data from DynamoDB or Postgres, generate the CSV, and send it directly to the target over email as an attachment using Amazon SES (Simple Email Service). You could also choose to store the CSV in S3 before sending it over email, to have as a backup in case email delivery doesn't work as expected (for one reason or another).
Tutorial: Schedule AWS Lambda Functions Using CloudWatch Events
Using File Attachments with Amazon SES

Amazon Pinpoint vs. Amazon SES/SMS

I would like to send a verification code to a specific user (only one) via email or text message. I have successfully done so through Amazon SES but I have not attempted through Amazon SMS yet. I have found myself going down the rabbit hole of investigating AWS Pinpoint.
It seems to me Pinpoint is meant for mass user messaging (text/email) rather than one-of individual messaging. I'm hoping I gathered that correctly.
My question, is there an advantage/disadvantage of using Pinpoint over Amazon SES and SMS for my use case?
This may be addressed by the Pinpoint FAQ
Q: I already use Amazon SNS or Amazon SES. What do I gain by switching
to Amazon Pinpoint?
In typical Amazon SNS and Amazon SES use cases, you have to set up
your application to manage each message's audience, content, and
delivery schedule. These same features are built in to Amazon
Pinpoint. With Amazon Pinpoint, you can create message templates,
delivery schedules, highly-targeted segments, and full campaigns.
Pinpoint also appears to be able to push notifications to users through the users preferred contact mechanism. This means that you are not limited to SMS and you reach your users with activation codes through the means they want to be reached. It also allows two-way communication.
The Pinpoint homepage also says:
You can send direct messages—such as order confirmations, welcome
messages, and one-time passwords—using the console or the Amazon
Pinpoint REST API. You can also use the API to build custom
applications that deliver campaign and transactional messages across
multiple channels.
This suggest it is suitable for your uses, though it has additional mass-communication features you do not currently need.
In addition to above points mentioned by #Freiheit you can send and receive SMS messages through Amazon Pinpoint. This will help you to track user response and create surveys, reviews and quiz like scenarios.
Check this AWS Documentation link

How to receive meeting requests through amazon SES

I am looking for a way to receive all of my company emails and locate those that contain meeting requests, then extract and store following meeting information in a dynamoDB
Creator
Start
End
Location
Attendees
Is this possible and if so is amazon SES the correct route? Can currently receive emails through SES and store in a S3 bucket, but the email is in MIME formate and not all of the meeting information is readily available.
Trying to avoid having to build fancy string passing functions to extract this information if possible.

How to check emails logs through AWS?

I have a Joomla website & it is configured to use AWS-SES for outgoing emails. Is there any way or logging by which I can check all outgoing emails from AWS/Joomla with minimum details like timestamp, sent to email id, subject.
Please let me know. Thanks
So while SES doesn't have any fully featured monitoring Suite, you can set SES up to deliver Delivery, Bounce and Complaint Notifications.
With these notifications, you can develop your own application or read the raw notifications that will show you what emails got delivered/bounced/complaints.
Full information on these notifications is available on the AWS Documentation:
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.html
You can publish your email sending events to an Amazon Kinesis Data Firehose delivery stream. This will take metadata from your sent emails and write it to an S3 bucket, which should produce your desired log.
Amazon has a tutorial on implementing this process at the link below.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/event-publishing-kinesis-analytics.html