@@ -62,8 +62,26 @@ def email_stream_changed(request, doc, old_stream, new_stream, text=""):
6262 "idrfc/stream_changed_email.txt" ,
6363 dict (text = text ,
6464 url = settings .IDTRACKER_BASE_URL + doc .get_absolute_url ()))
65+
66+ def email_pulled_from_rfc_queue (request , doc , comment , prev_state , next_state ):
67+ send_mail (request , ['IANA <iana@iana.org>' , 'rfc-editor@rfc-editor.org' ], None ,
68+ "%s changed state from %s to %s" % (doc .name , prev_state .name , next_state .name ),
69+ "idrfc/pulled_from_rfc_queue_email.txt" ,
70+ dict (doc = doc ,
71+ prev_state = prev_state ,
72+ next_state = next_state ,
73+ comment = comment ,
74+ url = settings .IDTRACKER_BASE_URL + doc .get_absolute_url ()),
75+ extra = extra_automation_headers (doc ))
76+
77+
78+ def email_authors (request , doc , subject , text ):
79+ to = [x .strip () for x in doc .author_list ().split (',' )]
80+ if not to :
81+ return
6582
66-
83+ send_mail_text (request , to , None , subject , text )
84+
6785def html_to_text (html ):
6886 return strip_tags (html .replace ("<" , "<" ).replace (">" , ">" ).replace ("&" , "&" ).replace ("<br>" , "\n " ))
6987
@@ -98,12 +116,15 @@ def email_adREDESIGN(request, doc, ad, changed_by, text, subject=None):
98116
99117
100118def generate_ballot_writeup (request , doc ):
119+ e = doc .latest_event (type = "iana_review" )
120+ iana = e .desc if e else ""
121+
101122 e = WriteupDocEvent ()
102123 e .type = "changed_ballot_writeup_text"
103124 e .by = request .user .get_profile ()
104125 e .doc = doc
105126 e .desc = u"Ballot writeup was generated"
106- e .text = unicode (render_to_string ("idrfc/ballot_writeup.txt" ))
127+ e .text = unicode (render_to_string ("idrfc/ballot_writeup.txt" , { 'iana' : iana } ))
107128 e .save ()
108129
109130 return e
@@ -263,6 +284,20 @@ def generate_approval_mail_rfc_editorREDESIGN(request, doc):
263284 generate_approval_mail = generate_approval_mailREDESIGN
264285 generate_approval_mail_rfc_editor = generate_approval_mail_rfc_editorREDESIGN
265286
287+ def generate_publication_request (request , doc ):
288+ group_description = ""
289+ if doc .group and doc .group .acronym != "none" :
290+ group_description = doc .group .name
291+ if doc .group .type_id in ("wg" , "rg" , "area" ):
292+ group_description += " %s (%s)" % (doc .group .type , doc .group .acronym )
293+
294+
295+ return render_to_string ("idrfc/publication_request.txt" ,
296+ dict (doc = doc ,
297+ doc_url = settings .IDTRACKER_BASE_URL + doc .get_absolute_url (),
298+ group_description = group_description ,
299+ )
300+ )
266301
267302def send_last_call_request (request , doc , ballot ):
268303 to = "iesg-secretary@ietf.org"
@@ -425,39 +460,13 @@ def formatted(val):
425460if settings .USE_DB_REDESIGN_PROXY_CLASSES :
426461 generate_issue_ballot_mail = generate_issue_ballot_mailREDESIGN
427462
428- def email_iana (request , doc , to , msg ):
429- # fix up message and send message to IANA for each in ballot set
430- import email
431- parsed_msg = email .message_from_string (msg .encode ("utf-8" ))
432-
433- for i in doc .idinternal .ballot_set ():
434- extra = {}
435- extra ["Reply-To" ] = "noreply@ietf.org"
436- extra ["X-IETF-Draft-string" ] = i .document ().filename
437- extra ["X-IETF-Draft-revision" ] = i .document ().revision_display ()
438-
439- send_mail_text (request , "To: IANA <%s>" % to ,
440- parsed_msg ["From" ], parsed_msg ["Subject" ],
441- parsed_msg .get_payload (),
442- extra = extra )
443-
444- def email_ianaREDESIGN (request , doc , to , msg ):
445- # fix up message and send it with extra info on doc in headers
446- import email
447- parsed_msg = email .message_from_string (msg .encode ("utf-8" ))
448-
463+ def extra_automation_headers (doc ):
449464 extra = {}
450465 extra ["Reply-To" ] = "noreply@ietf.org"
451466 extra ["X-IETF-Draft-string" ] = doc .name
452467 extra ["X-IETF-Draft-revision" ] = doc .rev
453-
454- send_mail_text (request , "IANA <%s>" % to ,
455- parsed_msg ["From" ], parsed_msg ["Subject" ],
456- parsed_msg .get_payload (),
457- extra = extra )
458468
459- if settings .USE_DB_REDESIGN_PROXY_CLASSES :
460- email_iana = email_ianaREDESIGN
469+ return extra
461470
462471def email_last_call_expired (doc ):
463472 text = "IETF Last Call has ended, and the state has been changed to\n %s." % doc .idinternal .cur_state .state
0 commit comments