Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

abhishekr700
Copy link

PR for mail support via SMTP

This commit adds the remaining error handling tests for the SMTP mail sending functionality.

- Adds a test to ensure `MissingRecipientsError` is raised when no recipients are provided for an admin email.
- Adds a test to ensure `InvalidSenderError` is raised for SMTP authentication errors.
- Adds a test to ensure a generic `Error` is raised for SMTP connection errors and missing `SMTP_HOST` configuration.
- Corrects the exception type raised in the `send()` method to use the base `Error` class for transient SMTP errors.
This change prefixes all environment variables related to the external SMTP mail service with `APPENGINE_` to improve namespacing and prevent potential conflicts in the deployment environment.

The following variables have been renamed:
- USE_SMTP_MAIL_SERVICE -> APPENGINE_USE_SMTP_MAIL_SERVICE
- SMTP_HOST -> APPENGINE_SMTP_HOST
- SMTP_PORT -> APPENGINE_SMTP_PORT
- SMTP_USER -> APPENGINE_SMTP_USER
- SMTP_PASSWORD -> APPENGINE_SMTP_PASSWORD
- SMTP_USE_TLS -> APPENGINE_SMTP_USE_TLS
- ADMIN_EMAIL_RECIPIENTS -> APPENGINE_ADMIN_EMAIL_RECIPIENTS

The changes have been applied to both the SDK implementation in `mail.py` and the corresponding unit tests in `mail_unittest.py
@abhishekr700 abhishekr700 changed the base branch from main to v1.2 August 6, 2025 12:17
@maigovannon maigovannon self-requested a review August 7, 2025 07:25
@YashBanka YashBanka merged commit 5c8c0b7 into GoogleCloudPlatform:v1.2 Aug 11, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants