Send Email using SQS, Lambda and SES

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • In this project, I have covered the steps for sending email using AWS services like SQS, lambda and SES. All the steps are covered in detail and the lambda python code to send the email is present below..
    github.com/gau...
    AWS Project work - send email to customers

Комментарии • 24

  • @JosephSeeley-cb6pv
    @JosephSeeley-cb6pv 8 месяцев назад +1

    Exactly what I needed Gaurav! Thanks so much for walking through this and providing sample code!!

  • @amitbajpai3431
    @amitbajpai3431 9 месяцев назад +1

    Nice explanation

  • @AndrewSu180
    @AndrewSu180 9 месяцев назад +1

    Why not set it up to parse the to and from addresses from the MIME content itself?

  • @velurubharath8929
    @velurubharath8929 Год назад

    Great video.

  • @LifeOfAayushii
    @LifeOfAayushii Год назад +1

    Hey, this was very helpful. I was wondering if you could help me in identifying resources on how to send SQS msgs from code to SQS queue with all the dynamic parameters and not hardcoded.

    • @AWSTrainingByGauravAgrawal
      @AWSTrainingByGauravAgrawal  Год назад +1

      Yes, below is the code to use aws lambda to send messages to the sqs queue.
      import os
      import boto3
      def send_message_to_sqs(queue_url, message_body):
      sqs = boto3.client('sqs')
      response = sqs.send_message(
      QueueUrl=queue_url,
      MessageBody=message_body
      )
      return response
      def lambda_handler(event, context):
      try:
      queue_url = os.environ.get('SQS_QUEUE_URL')
      message_body = "Hello, SQS!"
      if queue_url:
      response = send_message_to_sqs(queue_url, message_body)
      return {
      'statusCode': 200,
      'body': f"Message sent successfully. Message ID: {response['MessageId']}"
      }
      else:
      return {
      'statusCode': 500,
      'body': "SQS_QUEUE_URL environment variable is not set."
      }
      except Exception as e:
      return {
      'statusCode': 500,
      'body': f"An error occurred: {str(e)}"
      }
      Instructions:
      Here's how you can set it up:
      Create a new AWS Lambda function using the AWS Management Console.
      Configure the function to use the appropriate runtime (Python).
      Set the necessary environment variables (SQS_QUEUE_URL) in the Lambda function's configuration.
      Paste the modified code into the Lambda function's code editor.
      Save and deploy the Lambda function.
      When the Lambda function is triggered, it will attempt to send a message to the specified SQS queue using the provided environment variables.
      Please note that you need to ensure that the IAM role associated with the Lambda function has the necessary permissions to send messages to the SQS queue and access any other AWS resources required by your use case.

    • @LifeOfAayushii
      @LifeOfAayushii Год назад

      Thankyou so much. @@AWSTrainingByGauravAgrawal

  • @pandupatil149
    @pandupatil149 Год назад

    Hi Gaurav, As you mentioned, In Amazon SNS (Simple Notification Service/SES), the confirmation process for email subscriptions typically occurs only in sandbox and not in production environments. So if i deploy my code in producation environement there is no need of email subscription, as we can directly send an email to particular email?.
    2. How can i bypass email subscription process while i am implementing in my local?

    • @AWSTrainingByGauravAgrawal
      @AWSTrainingByGauravAgrawal  Год назад

      You cannot bypass email subscription in local and for production setup, subscription is not required

    • @pandupatil149
      @pandupatil149 Год назад

      @@AWSTrainingByGauravAgrawal Thank you Gaurav

    • @pandupatil149
      @pandupatil149 Год назад

      @@AWSTrainingByGauravAgrawal Hi Gaurav.. Though I am using the aws dev account of my organisation, it is still asking for verification

  • @BipinSinghITSupport
    @BipinSinghITSupport 7 месяцев назад

    this lambda code is not working.. Please help

  • @AliAsgar-zy7wp
    @AliAsgar-zy7wp 9 месяцев назад

    I dont know why i am not getting emails

  • @tanayaraut549
    @tanayaraut549 Год назад

    I didn't got the email

    • @AWSTrainingByGauravAgrawal
      @AWSTrainingByGauravAgrawal  Год назад

      Didn’t u got an email while setting up the email in SES ? Check your spam
      Folder also

    • @tanayaraut549
      @tanayaraut549 Год назад

      No I don't got I hav also check spam 😕​@@AWSTrainingByGauravAgrawal

    • @AWSTrainingByGauravAgrawal
      @AWSTrainingByGauravAgrawal  Год назад +1

      Please go through the video again then, mostly all of the associates have received the email.

    • @tanayaraut549
      @tanayaraut549 Год назад +1

      Yes vry helpful

    • @tanayaraut549
      @tanayaraut549 Год назад +1

      @@AWSTrainingByGauravAgrawal do u have any vdo of how to create an S3 bucket??