Setup Email Receiving AWS SES - node.js

How can i setup email receiving
I have nodejs server I want to build endpoint for fetching all emails
My Options are:
Option1:
save all incoming email to mongodb then I'll fetch it on Mongodb
Possible Problems:How? I have local server for now.
Option2:
Save email on aws (if Possibe) then fetch it

The easiest thing for you to do will to setup aws ses to save incoming emails to a designated s3 bucket. Once it is in the bucket you can do what you want with it, or even better, set up an s3 event notification that triggers another call (a lambda function for example), each time the email is put in the bucket for you to do your downstream processing of it.
As part of the AWS infrastructure, Amazon SES can also take action on
your mail, such as delivering it to an Amazon S3 bucket, publishing it
to an Amazon SNS topic, calling your custom code through AWS Lambda,
integrating with Amazon WorkMail, or bouncing the mail back to the
sender.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html

Related

How to give file URL hosted in s3 as a document remoteUrl for Dousign remote signing API?

Im trying to give my s3 file's url as a document remoteUrl in remote signing API. As it becomes easy to do this way, instead of downloading the file to my server and then pass on the doc to docusign API. When I made the bucket public, I was able to pass the object url as document remoteUrl and docusign was able to pick it up and send it for signature but my usecase is not a public bucket.
The s3 bucket only allows allowed domains, so I have added "https://account-d.docusign.com/" "https://account.docusign.com/" as allowed domains but even then I am facing this issue :
ERROR {errorCode: 'INVALID_REQUEST_PARAMETER',message: "The request contained at least one invalid parameter. An error occurred while downloading the data for document with id=1. Please ensure that the 'remoteUrl' parameter is correct."}
Are the docusign allowed domains correct or am I missing something?
OK, let's clear some confusion here.
First, DocuSign support various public cloud providers for cloud storage where you can have the files stored that will be sent to DocuSign to be part of an envelope sent for signature.
That list doesn't include Amazon S3, it is focused on end-user/consumer cloud storage and requires that you connect your DocuSign account to the cloud provider for authentication.
So the remoteURL property is not relevant to your scenario.
You can build an integration that goes to S3 using AWS APIs, get the file and then send it to DocuSign from wherever your app is hosted (AWS would make it easy) and if you do that - there's nothing different about sending a file you obtained from Amazon S3 vs. a file that was stored on-prem.

In aws pinpoint (NodeJS) how to trigger a email when custome event trigger by user

I am working on a NodeJs API which send a mail when New user added in AWS Pinpoint.
I need to trigger a mail when new user add in AWS Pinpoint or sign-in attempts or some transaction happens or credit in his/her account is less than 5.
I have already created a API which add and update user in AWS pinpoint as endpoints.But I stuck in, how to create a custom event which automatically do this task after updating the endpoint in AWS pinpoint.
I have referred https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Pinpoint.html link while trying to create custom event. But no proper solution found
you should only send an event, in the EndpointUser part of the payload, put your new user details, it will update the endpoint and will fire event, which you can catch with a campaign

Receiving custom data from AWS SES webhook events as we do in sendgrid?

I need to get custom data as part of email events (open, click, etc) sent from AWS SES.
For sendgrid I do (Java)
Personalization personalization = new Personalization();
personalization.addCustomArg("event_type", "SubscriptionDeliveryEmailEvent");
personalization.addCustomArg("event_source_type", "SubscriptionDelivery");
mail.addPersonalization(personalization);
How can I do the same for AWS SES? I couldn't even find a mention to it. (Java preferred pls :D)
AWS SES doesn’t provide any type of webhook out of the box for any type of event (open, click...)

AWS SES Email reply call the node api

I am developing an application on Nodejs-MongoDB and using AWS SES as mail server. In one case, the application has to send email to the user what I did perfectly using nodemailer plugins. But If the user replies on that mail, it will save to my database. I already created an api in nodejs which save the reply in database.
But I need to know the procedure how the replied mail calls my api with replied information.
I found AWS SES Receipt rule where one can set the rule for the receipt mail. Is there any proper approach to reach my requirement?

Uploading a file to Amazon S3, update a database and return a response

I see how to upload to Amazon S3 (from the client) and I see how to make requests to update a dynamoDB (from the client) but how do I upload a file to S3 such that I get a response back with "business logic" information?
For instance, I want to upload a photo to a uploadPhoto endpoint that will return to me the photoID of the photo in my dynamoDB model.
Yes I can upload a file to S3 and have it 'notify' Lambda but then its too late, S3 has already returned a response, Lambda can't send another response back to the client.
Its clear I shouldn't upload a file to Lambda.
So there is the API Gateway, its not clear that its a 'good idea' to upload files to API Gateway...
We just went through a similar scenario and unfortunately I think it comes down to 2 choices:
Use multiple requests - Client calls lambda to get presigned url, client uploads file directly to s3, then client calls back to lambda, lets it know the file has been uploaded and gets a response with all the business logic
One request - Create a service(likely on ec2) that sits in front of s3, so your client uploads directly to your service, your service then uploads to s3, does the business logic, and then sends the response back to the client. Definitely less work on the client but you get charged for twice as much bandwidth because you are uploading it twice.
We implemented #1 and it wasn't too hard. In our case the client is an Angular app so to the user it looks like one request but behind the scenes the app is making several calls.

Resources