简体   繁体   中英

Recieving emails with AWS SES/SNS

I am trying to a create email to in app message in a rails app that I am building. I am using SES to receive inbound emails and then send them to my rails app with SNS where I am trying to process them.

I can see in my production logs that SNS is hitting my endpoint but SNS is not sending any json with the request. I have no idea how to even begin debugging this.

These are the params that SNS is sending to POST "/email_processor"

Processing by EmailsController#recieved as HTML

 <ActionController::Parameters {"controller"=>"emails", "action"=>"recieved"} permitted: false>

Instead of using SNS, configure to trigger a Lambda function upon receiving an email. Then using the Lambda function you can call your rails backend with required parameters of the mail.

由于电子邮件可能很大,您可以配置SES然后将其保存到S3存储桶,而S3存储桶又可用于触发lambda函数或在Ruby中创建延迟作业,以便在完成工作时读取和删除文件!

I figured out a solution for this but I have no idea why it works. I have SES trigger and SNS which triggers lambda which sends the email to my endpoint. I have no idea why SNS is not sending any json with its request to my endpoint. SNS does send the full json payload to lambda. I'm not happy with this work around but it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM