Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To make our codebase more organized, we Since many components of the project need to send emails, we extracted this functionality and deployed an AWS Lambda specifically for sending emails in order to make our codebase more organized. The Lambda can be easily invoked by sending an HTTP GET request to https://1wviw5yf8a.execute-api.us-east-1.amazonaws.com/default/sendEmail with the following body:

Code Block
{
  "sender": "no-reply@diaper.cf",
  "recipient": "receipentEmail@example.com",
  "subject": "Subject",
  "bodyHtml": "Body HTML",
  "token":"!QR!$JDrR#xH#TD5fpl8"
}

Token

The token is used for authentication purpose. The Lambda will be executed synchronously and will respond a string once it finishes. The response will be "Email sent." if the email is successfully sent and an error message otherwise.

Sender address

For most cases, please use the default sender address no-reply@diaper.cf 

Example Usage (Python)

Code Block
languagepy
data = {
  "sender": "no-reply@diaper.cf",
  "recipient": "receipentEmail@example.com",
  "subject": "Subject",
  "bodyHtml": "Body HTML",
  "token":"!QR!$JDrR#xH#TD5fpl8"
}

r = requests.get('https://1wviw5yf8a.execute-api.us-east-1.amazonaws.com/default/sendEmail', data=json.dumps(data))
print(r.text)

...