Skip to main content
======================
Confirmed Email Sender
======================

This package provides a drop-in replacements for shortcut send_mail() and class
"EmailMultiAlternatives" which ensures that destination addresses are confirmed
before sending email to them.

The shortcut "send_mail_confirmed()" and class "ConfirmedEmailMessage" send email only
to confirmed addresses and automatically send confirmation messages to unconfirmed addresses.
It handles the confirmation process via a url in the confirmation message.

Messages for unconfirmed addresses will be queued until the address is confirmed
or a timeout period defaulting to 3 days elapses.

This app is configured with the same settings as Django's email backend plus
EMAIL_CONFIRMATION_WAIT which is an integer specifying the number of days to keep
queued messages for an unconfirmed address before deleting them. This setting
defaults to 3. You also need a valid domain name for Django's Sites framework
so the confirmation link is at the correct host.

If you're unfamiliar with the Sites framework, look for 'Sites' in the Django admin,
it should be self-explanatory.

ConfirmedEmailMessage.send() and send_email_confirmed() differ from the originals in
their return values. Instead of a return value of 0/1 to indicate failure/success there
can be a different status for each destination address. These return instead a dictionary with
each destination address as a key and a state indicating
success/failure/queued pending confirmation; see the documentation for
sender.ConfirmedEmailMessage.sent() for details.
This allows you to display a message indicating that confirmation is necessary if appropriate.

settings variables:

EMAIL_CONFIRMATION_WAIT: Number of days to wait between sending confirmation emails.
Defaults to 3 days.

EMAIL_CONFIRMATION_TEMPLATE: Template to use as the body of confirmation emails.
It's important for this template to contain a link for the user to click on
passed to the template via variable {{confirmation_link}}. See default template
'confirmation_email.txt' for an example.

ADDRESS_CONFIRMED_TEMPLATE: Template displayed to a user when they click on a confirmation link.
Defaults to 'address_confirmed.html' and has template variable
{{email_address}} passed to it.

Example (view) usage:

destination_address = 'noone@nowhere.com'
cem = ConfirmedEmailMessage(
subject='No Subject Needed',
body='Hi there.',
from_email='someservice@nowhere.com',
to=[destination_address],
)

send_results = cem.send()
if send_results[destination_address] == 'queued':
template = 'confirmation_required.html'
context = {'email_address': destination_address}
return render(request, template, context)

Metadata

Release files for django-confirmed-email 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-confirmed-email 0.0.7
File Size Uploaded Provenance Actions
django-confirmed-email-0.0.7.tar.gz 7.1 kB Without provenance Details for django-confirmed-email-0.0.7.tar.gz

Release files / django-confirmed-email-0.0.7.tar.gz

Download URL django-confirmed-email-0.0.7.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3532e1d39670483d4570ee75b445f2bbd175e04e562b79e683706b7e961b3103
BLAKE2b-256 checksum
How to use checksums
14cee229111b114b03ca01959b8522a4a56bf1385aa90c8daf93cbb96adb126e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-confirmed-email 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page