Skip to content

Commit

Permalink
Change: allow specifying recipient address when sending email test me…
Browse files Browse the repository at this point in the history
…ssage.

Closes #1224.
  • Loading branch information
arikfr committed Oct 9, 2016
1 parent 08676a3 commit 8e9e288
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit 8e9e288

Please sign in to comment.