Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Email Notification for Newsletter Subscription Toggles #1296

Open
DevalSam opened this issue Feb 28, 2025 · 0 comments
Open

Feat: Email Notification for Newsletter Subscription Toggles #1296

DevalSam opened this issue Feb 28, 2025 · 0 comments

Comments

@DevalSam
Copy link

DevalSam commented Feb 28, 2025

Feat: Email Notification for Newsletter Subscription Toggles

Description

A feature that would kick in after users unsubscribe from the newsletter. This feature necessitates the creation of an endpoint that generates and sends an email notification whenever a user toggles the unsubscribe button on or off (to resubscribe). This will ensure users are informed of changes in their subscription status.

Requirements

  1. Create an endpoint that triggers an email notification when users change their newsletter subscription status.
  2. The email should include:
    • Confirmation of the subscription status change (unsubscribed or resubscribed).
    • A link to manage their subscription preferences.
    • Contact information for support in case of issues.
  3. Ensure the endpoint is secure and only accessible to authenticated users.

Steps to Implement

  1. Identify the existing codebase location where the subscription toggle logic is handled.
  2. Create a new endpoint (e.g., /api/newsletter/unsubscribe-button) to handle the subscription toggle event.
  3. Integrate an email service (e.g., SendGrid, Mailgun) to send the notification emails.
  4. Write unit tests to ensure the endpoint and email functionality work as expected.
  5. Update the API documentation to include the new endpoint.

Expected Behavior

  • When a user toggles the unsubscribe button:
    • An email is sent confirming their new subscription status.
    • The email contains clear instructions and links for managing their preferences.
  • The endpoint should respond with a success message or appropriate error handling.

Current Behavior

  • Currently, no email notification is sent when a user toggles their subscription status.

Screenshots/Logs

Environment

  • OS: [e.g., macOS, Windows, Linux]
  • Browser/Device: [e.g., Chrome, Firefox, Safari]
  • Version: [e.g., 1.0.0]

Possible Solution

  1. Use a transactional email service (e.g., SendGrid) to handle email delivery.
  2. Implement the endpoint in the backend to trigger the email service when the subscription status changes.
  3. Ensure the email template is user-friendly and includes all necessary information.

Additional Context

  • This feature is critical for improving user experience and transparency regarding subscription status.
  • Consider adding a rate limit to the endpoint to prevent abuse.
  • Ensure compliance with email regulations (e.g., CAN-SPAM Act, GDPR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant