Thanks!
I've got it working now:
def mail_on_create_intro(sender, instance, created, **kwargs):
if created:
email_body = 'A new Intro at' + instance.url
email_subject = 'New Intro'
else:
email_body = 'An intro has changed at' + instance.url
email_s
Or:
def mail_on_create_intro(sender, created=None, **kwargs):
if created:
email_body = 'A new intro at ' + instance.url
email_subject = 'New intro'
else:
email_body = 'An intro has changed at ' + instance.url
email_subject = 'Changed Intro'
mail_
Try:
if 'created' in kwargs:
if kwargs['created']:
# Send email
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroup
Hi,
I have this code in myapp.intros.models to send a mail to the managers
each time an intro gets saved:
from django.db.models.signals import post_save
from django.core.mail import mail_managers
def mail_on_create_intro(sender, **kwargs):
if created:
email_body = 'A new intro a
4 matches
Mail list logo