Changeset 3114 in products for quintagroup.plonecomments/trunk/quintagroup/plonecomments/utils.py
- Timestamp:
- Apr 14, 2011 4:45:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonecomments/trunk/quintagroup/plonecomments/utils.py
r2754 r3114 1 1 import smtplib 2 from zope.i18n import translate3 2 from zope.i18nmessageid import MessageFactory 4 3 _ = MessageFactory("quintagroup.plonecomments") 5 4 from Products.CMFCore.utils import getToolByName 6 5 from Products.CMFPlone.utils import safe_unicode 7 from config import warning8 6 9 7 # Get apropriate property from (propery_sheeet) configlet … … 13 11 config_ps = getattr(pp, 'qPloneComments', None) 14 12 if config_ps: 15 result = 13 result = getattr(config_ps, prop_name, marker) 16 14 return result 17 15 … … 179 177 subject = translate(_(u"published_notification_subject", 180 178 default=u"[${organization_name}] New comment added", 181 mapping={u"organization_name" 179 mapping={u"organization_name": organization_name}), 182 180 context=context.REQUEST) 183 181 else: … … 194 192 subject = translate(_(u"approve_notification_subject", 195 193 default=u"[${organization_name}] New comment awaits moderation", 196 mapping={u"organization_name" 194 mapping={u"organization_name": organization_name}), 197 195 context=context.REQUEST) 198 196 else: … … 211 209 'mfrom': admin_email, 212 210 'obj': reply_parent, 213 'message': message,211 'message': message, 214 212 'organization_name': organization_name, 215 213 'name': creator_name, 216 'comment_id': comment_id,217 'comment_desc': comment.description,218 'comment_text': comment.text}214 'comment_id': comment_id, 215 'comment_desc': comment.description, 216 'comment_text': comment.text} 219 217 subject = translate(_(u"report_abuse_subject", 220 218 default=u"[${organization_name}] A comment on ${title} has " … … 233 231 host = context.plone_utils.getMailHost() 234 232 try: 235 host.secureSend(msg, user_email, admin_email, subject =subject,236 subtype = 'plain', debug = False, charset =charset)233 host.secureSend(msg, user_email, admin_email, subject=subject, 234 subtype='plain', debug=False, charset=charset) 237 235 except (smtplib.SMTPRecipientsRefused,smtplib.SMTPServerDisconnected): 238 236 setStatusMsg(None, context,
Note: See TracChangeset
for help on using the changeset viewer.