fix: do not render email if we arent sending email with notification
This commit is contained in:
parent
d59469e975
commit
a743a8136b
1 changed files with 8 additions and 6 deletions
|
|
@ -117,14 +117,16 @@ class NotificationModel(BaseModel):
|
|||
# add mentioned users into recipients
|
||||
final_recipients = set(recipients_objs).union(mention_recipients)
|
||||
|
||||
(subject, email_body, email_body_plaintext) = \
|
||||
EmailNotificationModel().render_email(notification_type, **email_kwargs)
|
||||
# No need to render email if we are sending just notification
|
||||
if with_email:
|
||||
(subject, email_body, email_body_plaintext) = \
|
||||
EmailNotificationModel().render_email(notification_type, **email_kwargs)
|
||||
|
||||
if not notification_subject:
|
||||
notification_subject = subject
|
||||
if not notification_subject:
|
||||
notification_subject = subject
|
||||
|
||||
if not notification_body:
|
||||
notification_body = email_body_plaintext
|
||||
if not notification_body:
|
||||
notification_body = email_body_plaintext
|
||||
|
||||
notification = Notification.create(
|
||||
created_by=created_by_obj, subject=notification_subject,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue