Reputation:
is possible to use the AWS SNS in the client, with Javascript?? I am creating a website that has a booking form , and I would like to send an email notification as soon as the user presses the submit button, for this I thought of using the Simple Notification Service, however I 'm not finding the documentation using with the client side. Would anyone tell me if it is possible ? I've searched on google and did not get a satisfactory answer.
Upvotes: 0
Views: 1982
Reputation: 1075
Yes, you can use SNS from the client, the SNS JavaScript SDK explains how you can do that. However, as John R said that's the wrong tool for the job. You really want to be using SES to send email.
Regardless of which one you use the biggest obstacle is not the code, it is the authentication from the client side, look here to get started.
For whatever its worth, I do not think that's your best approach. Unless your users can spot milli second differences I would just do it on the server side. I do not know what server side language you are using, but any of the ones that have an AWS SDK make this trivially easy to do.
Note though that AWS does not allow you to send production emails before you are verified. I would suggest you read through the AWS documentation for SES first. They are pretty comprehensive.
Upvotes: 2
Reputation: 269826
The Amazon Simple Notification Service can send a notification to subscribers in several ways:
Messages are sent to an SNS Topic. Any subscribers to the topic then receive a copy of the notification. All subscriptions to a Topic must be confirmed.
Therefore, I would not recommend using SNS as a method of sending an email to your users. Instead, use the Amazon Simple Email Service (SES), which is designed to improve deliverability for outbound email.
There is a JavaScript SDK that can connect to SES.
Upvotes: 0