AWS Builder Center

Weekend Productivity Challenge: Develop a complete Customer Email Analysing Bot

Customer sending email to the support and we will analyse and prioritize the email based on its sentiments using bedrock

Complete Architecture: Setting up SES on domain and establishing connection to receive email, Received email would be stored in S3 Bucket and then lambda function would trigger  and analyse that mail through Bedrock and then that analysis would be stored in analysed s3 Bucket. This is completely Serverless Application

Customer Service
Create two S3 Bucket
1st bucket: to save the raw incoming customer service email messages
2nd bucket: to store analyzed structured json from email
Create Lambda Function
Create a New EmailManager Execution Role
Click Create Function
Now add this in your bucket policy:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowLambdaRead",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::695090996331:role/EmailManager-role-4hrbai45"
      },
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-s3-bucket/*"
    }
  ]
}
Once done now we will configure SES
Add your domain to SES and complete the steps to get production access
Once done now we will setup Email Receiving to S3
Click Email Receiving
Click Create Rule Set
Rule Set Name: Customer-incoming-mail
Click Set as Active
It would be active
Now  update your lambda code:
Now send test email:
From:  your_name@gmail.com  To:  support@your_domain.com  Subject: Payment deducted twice
Hello Team,
I ordered your AWS training course yesterday.
Unfortunately, my credit card was charged twice although I only placed one order.
Please refund the duplicate payment.
Regards, John Doe +91 9876543210
Click Send
This will store the email to your s3 bucket
It would then invoke lambda function for analysing this email and would be stored in your analysed email:
Download the file and view the result
Open the file
Congratulations you have learnt to develop a Complete Customer Support Email Service.
Github Repository for Complete Code:  harshvaidya04/Serverless_Email_Manager 
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article