views:

18

answers:

2

Goal: On submission of a form to add/update/delete objects an email is sent out with the current contents of the DB object and the new contents of the DB object in html.

Example

Object Title was oldTitle and has been changed to newTitle
Object Date was oldDate and has been changed to newDate

My assumption this can be done two different ways. Directly through send_mail or via signals. My gut leans towards using signals to make sure I can grab previous content and the new content but I am not quite sure if this is the right way to go. Any advice you can give would be much appreciated. I couldn't find very much on this subject online.

+1  A: 

Queue up the message to be sent in the pre_save signal, and send (or reap) them in the post_save signal.

Ignacio Vazquez-Abrams
This is along the lines I was thinking. I will give this a shot and see if it will work the way I need it to. Thanks
Dronestudios
A: 

Try overriding save() in your model objects, and grabbing the fields in question before calling super().

Here's a database email queue I wrote, which may help you with the actual sending of the mail:

http://gist.github.com/629663

fish2000
Interesting, I will check this out. Thanks!
Dronestudios