Merge pull request #1334 from getredash/add-yaxis-scales

Change: allow specifying recipient address when sending email test message
This commit is contained in:
Arik Fraimovich 2016-10-09 09:19:08 +03:00 committed by GitHub
commit 015b1dc8fd

View File

@ -47,12 +47,16 @@ def check_settings():
for name, item in settings.all_settings().iteritems(): for name, item in settings.all_settings().iteritems():
print "{} = {}".format(name, item) 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 redash import mail
from flask_mail import Message 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__': if __name__ == '__main__':