From: cabraham <svn...@pl...> - 2007-01-31 19:58:29
|
Author: cabraham Date: Wed Jan 31 19:58:19 2007 New Revision: 36602 Modified: listen/branches/openplans-refactor2/content/send_mail.py listen/branches/openplans-refactor2/lib/default_email_text.py Log: added missing email functions for post handling Modified: listen/branches/openplans-refactor2/content/send_mail.py ============================================================================== --- listen/branches/openplans-refactor2/content/send_mail.py (original) +++ listen/branches/openplans-refactor2/content/send_mail.py Wed Jan 31 19:58:19 2007 @@ -111,3 +111,52 @@ subject = subject.encode('ascii') member_mail = user_email.encode('ascii') self.context.sendCommandRequestMail(member_mail, subject, translate(body)) + + def user_already_pending(self, user_email, user_name, pin): + if not user_name: user_name = user_email + subject = "mail-command:confirm-member %s [%s]" % (user_email, pin) + body = default_email_text.user_already_pending + mapping = { 'fullname': user_name, + 'listname': self.context.title, + 'listadmin': self.context.list_owner, } + body = Message(body, mapping=mapping) + subject = subject.encode('ascii') + member_mail = user_email.encode('ascii') + self.context.sendCommandRequestMail(member_mail, subject, translate(body)) + + def user_post_request(self, user_email, user_name, pin): + if not user_name: user_name = user_email + subject = "mail-command:confirm-member %s [%s]" % (user_email, pin) + body = default_email_text.user_post_request + mapping = { 'fullname': user_name, + 'listname': self.context.title, + 'listadmin': self.context.list_owner, } + body = Message(body, mapping=mapping) + subject = subject.encode('ascii') + member_mail = user_email.encode('ascii') + self.context.sendCommandRequestMail(member_mail, subject, translate(body)) + + def admin_mod_post_request(self, user_email, user_name): + if not user_name: user_name = user_email + subject = "post requiring moderation" + body = default_email_text.admin_mod_post_request + mapping = { 'fullname': user_name, + 'listname': self.context.title, + 'listadmin': self.context.list_owner, } + body = Message(body, mapping=mapping) + subject = subject.encode('ascii') + member_mail = user_email.encode('ascii') + self.context.sendCommandRequestMail(member_mail, subject, translate(body)) + + def user_post_mod_notification(self, user_email, user_name): + if not user_name: user_name = user_email + subject = "message pending moderation" + body = default_email_text.user_post_mod_notification + mapping = { 'fullname': user_name, + 'listname': self.context.title, + 'listadmin': self.context.list_owner, } + body = Message(body, mapping=mapping) + subject = subject.encode('ascii') + member_mail = user_email.encode('ascii') + self.context.sendCommandRequestMail(member_mail, subject, translate(body)) + Modified: listen/branches/openplans-refactor2/lib/default_email_text.py ============================================================================== --- listen/branches/openplans-refactor2/lib/default_email_text.py (original) +++ listen/branches/openplans-refactor2/lib/default_email_text.py Wed Jan 31 19:58:19 2007 @@ -97,6 +97,55 @@ List Admin ''') +user_already_pending = _(u'user_already_pending_body',u''' +Hello ${fullname}, + +We have received more than one message from you to the ${listname} +mailing list. In order to be able to send message to this list, +please reply to this message leaving the subject line unchanged. +After you have confirmed your email address, you may resend your +message. + +Please send questions to ${listadmin}. + +Yours, +List Admin +''') + +user_post_request = _(u'user_post_request_body',u''' +Hello ${fullname}, + +We have received a message from you to the ${listname} mailing +list. In order to be able to send message to this list, +please reply to this message leaving the subject line unchanged. +After you have confirmed your email address, your message will +be processed. + +Please send questions to ${listadmin}. + +Yours, +List Admin +''') + +admin_mod_post_request = _(u'admin_mod_post_request_body',u''' +Hello List Admin, + +${fullname} has sent a message to the ${listname} mailing list +and it is waiting for your approval. + +''') + +user_post_mod_notification = _(u'user_post_mod_notification',u''' +Hello ${fullname}, + +We have received a message from you to the ${listname} mailing +list. The message is waiting for approval from a list admin. + +Please send questions to ${listadmin}. + +Yours, +List Admin +''') # unused so far |