Task Description
In this task, your system needs to be extended to send an email notification to the creator of a shortened link every time someone clicks on it. The creator’s email address is stored in Cognito, and there is a property in Cognito called shouldRecieveNotifications (boolean). Emails should only be sent if this property is set to true.
However, keep in mind that Amazon SES (Simple Email Service) has limits on how many emails can be sent within a short period of time. You must ensure that your system does not exceed these limits and manages email sending appropriately to avoid throttling or blocking by SES.
Task Requirements
- Each time a shortened link is clicked, the system must send an email notification to the link creator only if their
shouldRecieveNotificationsproperty in Cognito is set totrue. - The creator’s email address must be retrieved from Cognito based on the user who created the link.
- The email should notify the creator that their link has been clicked, and it should include the URL of the shortened link.
- Amazon SES must be used to send the email, and the system should be designed to handle SES sending limits to avoid exceeding these limits.
Technical Requirements
- Email Notification – After a user clicks a shortened link, the system must:
- Retrieve the creator’s email and the
shouldRecieveNotificationsproperty from Cognito. - Send an email notification only if
shouldRecieveNotificationsistrue.
- Retrieve the creator’s email and the
- SES Rate Limiting – SES has rate limits on the number of emails that can be sent in a given period. Your system must account for this by queuing or delaying emails to ensure that the limit is not exceeded.
- Retry Mechanism – In case SES temporarily rejects an email due to limits being reached, implement a retry mechanism to ensure that the email is eventually sent once the rate limit is reset.
Task
Draw your solution on paper and use the AWS icons provided for the services you plan to use. Your solution should include:
- The architecture of the system, showing how link clicks trigger the email notification process.
- Use case diagrams that demonstrate the steps involved in retrieving the creator’s email and
shouldRecieveNotificationsproperty from Cognito and sending the notification via SES. - Diagrams showing how the system handles SES rate limits, including queuing or delaying email sends to ensure compliance with SES limits.