Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: allow specifying recipient address when sending email test message #1334

Merged
merged 1 commit into from
Oct 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ def check_settings():
for name, item in settings.all_settings().iteritems():
print "{} = {}".format(name, item)

@manager.command
def send_test_mail():

@manager.option('email', default=None, help="Email address to send test message to (default: the address you defined in MAIL_DEFAULT_SENDER)")
def send_test_mail(email=None):
from redash import mail
from flask_mail import Message

mail.send(Message(subject="Test Message from re:dash", recipients=[settings.MAIL_DEFAULT_SENDER], body="Test message."))
if email is None:
email = settings.MAIL_DEFAULT_SENDER

mail.send(Message(subject="Test Message from re:dash", recipients=[email], body="Test message."))


if __name__ == '__main__':
Expand Down