mirror of https://github.com/zulip/zulip.git
emails: Call send_email when DEVELOPMENT_LOG_EMAILS is enabled.
The previous version was also doing almost the same thing. But checking for DEVELOPMENT_LOG_EMAILS would allow us to control the call of send_email by altering the value of DEVELOPMENT_LOG_EMAILS in tests.
This commit is contained in:
parent
cb9b526f0c
commit
b10c23c233
|
@ -125,7 +125,7 @@ def send_future_email(template_prefix: str, realm: Realm, to_user_ids: Optional[
|
||||||
email_fields = {'template_prefix': template_prefix, 'to_user_ids': to_user_ids, 'to_emails': to_emails,
|
email_fields = {'template_prefix': template_prefix, 'to_user_ids': to_user_ids, 'to_emails': to_emails,
|
||||||
'from_name': from_name, 'from_address': from_address, 'context': context}
|
'from_name': from_name, 'from_address': from_address, 'context': context}
|
||||||
|
|
||||||
if settings.DEVELOPMENT and not settings.TEST_SUITE:
|
if settings.DEVELOPMENT_LOG_EMAILS:
|
||||||
send_email(template_prefix, to_user_ids=to_user_ids, to_emails=to_emails, from_name=from_name,
|
send_email(template_prefix, to_user_ids=to_user_ids, to_emails=to_emails, from_name=from_name,
|
||||||
from_address=from_address, context=context)
|
from_address=from_address, context=context)
|
||||||
# For logging the email
|
# For logging the email
|
||||||
|
|
Loading…
Reference in New Issue