mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-24 13:00:36 +08:00
Merge pull request #91 from intonarumori/develop
added option to disable register email
This commit is contained in:
@@ -158,6 +158,8 @@ Miscellaneous
|
||||
.. tabularcolumns:: |p{6.5cm}|p{8.5cm}|
|
||||
|
||||
======================================= ========================================
|
||||
``SECURITY_SEND_REGISTER_EMAIL`` Specifies whether registration email is
|
||||
sent. Defaults to ``True``.
|
||||
``SECURITY_CONFIRM_EMAIL_WITHIN`` Specifies the amount of time a user has
|
||||
before their confirmation link expires.
|
||||
Always pluralized the time unit for this
|
||||
|
||||
@@ -56,6 +56,7 @@ _default_config = {
|
||||
'TRACKABLE': False,
|
||||
'PASSWORDLESS': False,
|
||||
'CHANGEABLE': False,
|
||||
'SEND_REGISTER_EMAIL': True,
|
||||
'LOGIN_WITHIN': '1 days',
|
||||
'CONFIRM_EMAIL_WITHIN': '5 days',
|
||||
'RESET_PASSWORD_WITHIN': '5 days',
|
||||
|
||||
@@ -36,7 +36,8 @@ def register_user(**kwargs):
|
||||
user_registered.send(dict(user=user, confirm_token=token),
|
||||
app=app._get_current_object())
|
||||
|
||||
send_mail(config_value('EMAIL_SUBJECT_REGISTER'), user.email, 'welcome',
|
||||
user=user, confirmation_link=confirmation_link)
|
||||
if config_value('SEND_REGISTER_EMAIL'):
|
||||
send_mail(config_value('EMAIL_SUBJECT_REGISTER'), user.email, 'welcome',
|
||||
user=user, confirmation_link=confirmation_link)
|
||||
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user