Merge branch 'bugfix/10-email-notif-created' into 'master'
bugfix: send email only when notif created #10 See merge request startinblox/djangoldp-packages/djangoldp-notifications!13
This commit is contained in:
commit
4c01ef39d5
@ -74,8 +74,8 @@ def send_request(target, object_iri):
|
|||||||
|
|
||||||
|
|
||||||
@receiver(post_save, sender=Notification)
|
@receiver(post_save, sender=Notification)
|
||||||
def send_email_on_notification(sender, instance, **kwargs):
|
def send_email_on_notification(sender, instance, created, **kwargs):
|
||||||
if instance.summary and settings.JABBER_DEFAULT_HOST and instance.user.email:
|
if created and instance.summary and settings.JABBER_DEFAULT_HOST and instance.user.email:
|
||||||
html_message = loader.render_to_string(
|
html_message = loader.render_to_string(
|
||||||
'email.html',
|
'email.html',
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user