infrastructure.email.stub_email_service¶
src.infrastructure.email.stub_email_service
¶
StubEmailService - Console logging implementation for development.
Fake email service that logs to console instead of sending real emails. Used in development, testing, and CI environments.
Classes¶
StubEmailService
¶
Stub email service for development (logs to console).
Implements EmailProtocol by logging email details instead of sending. No external dependencies, no AWS account required.
Use in development/testing to: - See what emails would be sent - Verify verification URLs and reset links - Test authentication flows without AWS SES
Attributes:
| Name | Type | Description |
|---|---|---|
logger |
Logger for outputting email details. |
Example
from src.core.container import get_logger email_service = StubEmailService(logger=get_logger()) await email_service.send_verification_email( ... to_email="user@example.com", ... verification_url="https://app.com/verify?token=abc123", ... )
Logs: [EMAIL STUB] Would send verification email to user@example.com...¶
Source code in src/infrastructure/email/stub_email_service.py
Functions¶
__init__
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
LoggerProtocol
|
Logger instance for console output. |
required |
send_verification_email
async
¶
Log email verification details to console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
to_email
|
str
|
Recipient email address. |
required |
verification_url
|
str
|
Full URL with verification token. |
required |
Source code in src/infrastructure/email/stub_email_service.py
send_password_reset_email
async
¶
Log password reset details to console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
to_email
|
str
|
Recipient email address. |
required |
reset_url
|
str
|
Full URL with password reset token. |
required |
Source code in src/infrastructure/email/stub_email_service.py
send_password_changed_notification
async
¶
Log password changed notification to console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
to_email
|
str
|
Recipient email address. |
required |