r252613 - PloneGazette/branches/redturtle-fixes
"Luca Fabbri" <svn-changes-z4DKO/[email protected]> Wed, 2 Oct 2013 15:34:06 +0000 (UTC)
| Newsgroups | gmane.comp.web.zope.plone.collective.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: keul
Date: Wed Oct 2 15:34:06 2013
New Revision: 252613
Modified:
PloneGazette/branches/redturtle-fixes/HISTORY.txt
PloneGazette/branches/redturtle-fixes/NewsletterTheme.py
Log:
- use MailHost.send before trying to use MailHost.secureSend
- Can now use an alternative mail host providing a new site property with id ``plonegazette_mailhost`` (can be used to use MaildropHost)
Modified: PloneGazette/branches/redturtle-fixes/HISTORY.txt
==============================================================================
--- PloneGazette/branches/redturtle-fixes/HISTORY.txt (original)
+++ PloneGazette/branches/redturtle-fixes/HISTORY.txt Wed Oct 2 15:34:06 2013
@@ -18,6 +18,9 @@
- can override "b_size" in subscribers_infos from request [keul]
- now link check if *one* of the CSS classes is ``internal-link``
(not comparing with the whole ``class`` attribute) [keul]
+ - use MailHost.send before trying to use MailHost.secureSend [keul]
+ - Can now use an alternative mail host providing a new site property with id ``plonegazette_mailhost``
+ (can be used to use MaildropHost) [keul]
3.0.1-SNAPSHOT (UNRELEASED)
===========================
Modified: PloneGazette/branches/redturtle-fixes/NewsletterTheme.py
==============================================================================
--- PloneGazette/branches/redturtle-fixes/NewsletterTheme.py (original)
+++ PloneGazette/branches/redturtle-fixes/NewsletterTheme.py Wed Oct 2 15:34:06 2013
@@ -587,8 +587,13 @@
def sendmail(self, mailfrom, mailto, mailBody, subject = None):
""""""
portal = getToolByName(self, 'portal_url').getPortalObject()
- mail_host = getattr(self, 'MailHost', None)
- mail_host.secureSend(mailBody, mailto, mailfrom, subject=subject)
+ portal_properties = getToolByName(self, 'portal_properties')
+ mail_host_id = getattr(portal_properties.site_properties, 'plonegazette_mailhost', 'MailHost')
+ mail_host = getattr(self, mail_host_id, None)
+ try:
+ mail_host.send(str(mailBody), mailto, mailfrom, subject=subject)
+ except AttributeError:
+ mail_host.secureSend(mailBody, mailto, mailfrom, subject=subject)
security.declarePublic('getRenderTemplate')
def getRenderTemplate(self, recompile=0):
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk