Merge lp:~daniel-watkins-credativ/poweremail/save_to_drafts into lp:~openerp-commiter/poweremail/poweremail-v6

Proposed by Daniel Watkins (credativ)
Status: Merged
Merged at revision: 216
Proposed branch: lp:~daniel-watkins-credativ/poweremail/save_to_drafts
Merge into: lp:~openerp-commiter/poweremail/poweremail-v6
Diff against target: 48 lines (+13/-7)
2 files modified
poweremail_template.py (+12/-7)
poweremail_template_view.xml (+1/-0)
To merge this branch: bzr merge lp:~daniel-watkins-credativ/poweremail/save_to_drafts
Reviewer Review Type Date Requested Status
Niels Huylebroeck (community) Approve
Review via email: mp+34852@code.launchpad.net

Description of the change

This adds a 'Save to Drafts' option to templates, which will save automatically generated emails as Drafts, rather than sending them.

The use case is wanting to generate an email n days after an object is created, that can then be customised and sent off.

To post a comment you must log in.
Revision history for this message
Niels Huylebroeck (red15) wrote :

Very nice, we use this for reviewing outbound mails which pile up during the day.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'poweremail_template.py'
2--- poweremail_template.py 2010-07-29 14:52:57 +0000
3+++ poweremail_template.py 2010-09-08 12:30:55 +0000
4@@ -271,6 +271,10 @@
5 " action for you which automatically sends mail after a"
6 " new record is created.\nNote:Auto email can be enabled"
7 " only after saving template."),
8+ 'save_to_drafts':fields.boolean('Save to Drafts',
9+ help="When automatically sending emails generated from"
10+ " this template, save them into the Drafts folder rather"
11+ " than sending them immediately."),
12 #Referred Stuff - Dont delete even if template is deleted
13 'attached_wkf':fields.many2one(
14 'workflow',
15@@ -1008,13 +1012,14 @@
16 # This prevents attempts by the scheduler to send
17 # Emails before all the work is complete in
18 # Generating email, attachments and event
19- self.pool.get('poweremail.mailbox').write(
20- cursor,
21- user,
22- mailbox_id,
23- {'folder':'outbox'},
24- context=context
25- )
26+ if not template.save_to_drafts:
27+ self.pool.get('poweremail.mailbox').write(
28+ cursor,
29+ user,
30+ mailbox_id,
31+ {'folder':'outbox'},
32+ context=context
33+ )
34 return True
35
36 poweremail_templates()
37
38=== modified file 'poweremail_template_view.xml'
39--- poweremail_template_view.xml 2010-07-29 14:52:57 +0000
40+++ poweremail_template_view.xml 2010-09-08 12:30:55 +0000
41@@ -184,6 +184,7 @@
42 attrs="{'required':[('auto_email','=',True)],'readonly':[('auto_email','=', False)]}" />
43 <field name="send_on_create" />
44 <field name="send_on_write" />
45+ <field name="save_to_drafts" />
46 <separator string="Email action and wizard"
47 colspan="4" />
48 <field name="server_action" readonly="1" />

Subscribers

People subscribed via source and target branches