mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 03:43:42 -08:00
make test email not require login
This commit is contained in:
parent
c1c7e22faa
commit
3f28c20d1e
1 changed files with 6 additions and 2 deletions
|
@ -454,10 +454,14 @@ def test():
|
|||
|
||||
@bp.route('/test_email')
|
||||
def test_email():
|
||||
send_email('This is a test email', f'{g.site.name} <{current_app.config["MAIL_FROM"]}>', [current_user.email],
|
||||
if current_user.is_anonymous:
|
||||
email = request.args.get('email')
|
||||
else:
|
||||
email = current_user.email
|
||||
send_email('This is a test email', f'{g.site.name} <{current_app.config["MAIL_FROM"]}>', [email],
|
||||
'This is a test email. If you received this, email sending is working!',
|
||||
'<p>This is a test email. If you received this, email sending is working!</p>')
|
||||
return f'Email sent to {current_user.email}.'
|
||||
return f'Email sent to {email}.'
|
||||
|
||||
|
||||
@bp.route('/find_voters')
|
||||
|
|
Loading…
Add table
Reference in a new issue