![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Readme
This is the Open Learning Django Mail app. It provides a few key features around mail:
pip install mitol-django-mail
Add the mail app:
INSTALLED_APPS = [
...
"mitol.mail.apps.MailApp",
]
SITE_BASE_URL
- the website's host url, including the protocol (e.g. "https://example.com/")SITE_NAME
- the website's nameAll settings for the mitol-django-mail
app are namespaced in django settings with MITOL_MAIL_
prefix.
MITOL_MAIL_FROM_EMAIL
- the default from email for all messagesMITOL_MAIL_REPLY_TO_ADDRESS
- the default reply-to email for all messagesMITOL_MAIL_MESSAGE_CLASSES
- a list of fully qualified message class names that make the message classes available in the debuggerMITOL_MAIL_ENABLE_EMAIL_DEBUGGER
- True
if the email debugger should be enabled, you probably want to set this to the same value as DEBUG
MITOL_MAIL_RECIPIENT_OVERRIDE
- only used locally, this overrides the recipient of all outgoing email messagesMITOL_MAIL_FORMAT_RECIPIENT_FUNC
- (optional) set to a custom function to format recipients. You'll typically use this if you're storing the name in a place other that Django's builtin User
model. Default: "mitol.mail.defaults.format_recipient"
.MITOL_MAIL_CAN_EMAIL_USER_FUNC
- (optional) set to a custom function to determine whether a user can be sent an email. You'll typically use this if you have additional criteria beyond the user having an email. Default: "mitol.mail.defaults.can_email_user"
.MITOL_MAIL_CONNECTION_BACKEND
- the connection backend to use for email sending. You'd use this only if you're doing something really custom that anymail
doesn't give you. Default: "anymail.backends.mailgun.EmailBackend"
.This involves subclassing mitol.mail.messages.TemplatedMessage
. To subclass, do the following:
template_name
attribute - str
that denotes the directory within templates/mail
that this message's templates reside in (e.g. "password_reset"
)name
attribute - a human-friendly name for your message (e.g. "Password Reset"
)get_debug_template_context
- static method that returns a context dict for rendering the email in the debuggerIn your apps's templates
directory, create some templates:
templates/
mail/
{template_name}/
subject.txt
body.html
Add your custom message class to MITOL_MAIL_MESSAGE_CLASSES
so it is available in the debugger.
Optionally, you can also override:
get_base_template_context
- extend the default base template context used with all emails of this type. Return type is a dict
. As a best practice you should be merging with super().get_base_template_context()
.get_default_headers
- extend the default headers included with all emails of this type. Return type is a dict
. As a best practice you should be merging with super().get_default_headers()
.FAQs
MIT Open Learning django app extensions for mail
We found that mitol-django-mail demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.