Files
zulip/zerver/management/commands/send_test_email.py
Rishi Gupta a26703109e settings: Change all uses of ZULIP_ADMINISTRATOR to FromAddress.SUPPORT.
Make it less likely that further development will break compatibility with
ZULIP_ADMINISTRATORs of the form "name <email>".

Note that the suggested value for this setting has been
'zulip-admin@example.com' for a while, so hopefully this commit causes no
change for most installations.
2017-07-05 15:33:01 -07:00

26 lines
912 B
Python

from __future__ import absolute_import
from typing import Any
from django.conf import settings
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.commands import sendtestemail
from zerver.lib.send_email import FromAddress
class Command(sendtestemail.Command):
def handle(self, *args, **kwargs):
# type: (*Any, **str) -> None
subject = "Zulip Test email"
message = ("Success! If you receive this message, you've "
"successfully configured sending email from your "
"Zulip server.")
sender = FromAddress.SUPPORT
send_mail(subject, message, sender, kwargs['email'])
if kwargs['managers']:
mail_managers(subject, "This email was sent to the site managers.")
if kwargs['admins']:
mail_admins(subject, "This email was sent to the site admins.")