app.emails ========== .. py:module:: app.emails .. autoapi-nested-parse:: Email sending utilities for the Mail List Shield application. This module provides functions for sending various types of emails including password reset, email verification, and subscription notifications. All emails are sent asynchronously to avoid blocking the main thread. Functions --------- .. autoapisummary:: app.emails.send_email_to_reset_password app.emails.send_email_with_code app.emails.send_email_about_subscription_confirmation app.emails.send_email_about_subscription_cancellation app.emails.send_email_about_subscription_deletion app.emails.send_async_email Module Contents --------------- .. py:function:: send_email_to_reset_password(email) Send an email with the password reset link. :param email: The email address of the user. .. py:function:: send_email_with_code(user) Send an email with the verification code. Implements rate limiting: only sends if at least 60 seconds have passed since the last email, and limits total emails to 5. :param user: The user object from the database. .. py:function:: send_email_about_subscription_confirmation(user, tier_name) Send an email with the paid subscription confirmation. :param user: The user object from the database. :param tier_name: The name of the subscription tier. .. py:function:: send_email_about_subscription_cancellation(user, tier_name, cancellation_date) Send an email with the subscription cancellation information. This is the email sent when the user cancels their subscription but the subscription is still active until the end of the billing period. :param user: The user object from the database. :param tier_name: The name of the subscription tier. :param cancellation_date: The date of cancellation. .. py:function:: send_email_about_subscription_deletion(user, tier_name) Send an email with the subscription deletion information. This is the email sent when the subscription has ended. :param user: The user object from the database. :param tier_name: The name of the subscription tier. .. py:function:: send_async_email(msg, app) Send an email asynchronously. :param msg: The Message object containing email details. :param app: The Flask application instance.