Exemplo n.º 1
0
 def _makeEmail(self):
     mtext = self.index()
     headers = {
         'Subject': self._subject,
         'From': self._from,
         'To': u'<{0}>'.format(self.email)
     }
     return makeEmail(mtext, self.context, headers)
Exemplo n.º 2
0
ptool = getToolByInterfaceName(script,
                               'Products.CMFCore.interfaces.IPropertiesTool')
utool = getToolByInterfaceName(script, 'Products.CMFCore.interfaces.IURLTool')
portal_url = utool()

options = {}

options['portal_title'] = ptool.title()
options['portal_description'] = ptool.getProperty('description')
options['portal_url'] = portal_url

member_id = member and member.getId() or 'foo'
options['member_id'] = member_id
options['password'] = password

target = atool.getActionInfo('user/login')['url']
options['login_url'] = '%s' % target

email_from_name = ptool.getProperty('email_from_name')
options['signature'] = email_from_name

headers = {}
headers['Subject'] = _(u'${portal_title}: Your Membership Information',
                       mapping={'portal_title': decode(ptool.title(), script)})
headers['From'] = '%s <%s>' % (email_from_name,
                               ptool.getProperty('email_from_address'))
headers['To'] = '<%s>' % email

mtext = context.registered_email_template(**decode(options, script))
return makeEmail(mtext, script, headers)
Exemplo n.º 3
0
ptool = getToolByInterfaceName('Products.CMFCore.interfaces.IPropertiesTool')
utool = getToolByInterfaceName('Products.CMFCore.interfaces.IURLTool')
portal_url = utool()


options = {}

options['portal_title'] = ptool.title()
options['portal_description'] = ptool.getProperty('description')
options['portal_url'] = portal_url

member_id = member and member.getId() or 'foo'
options['member_id'] = member_id
options['password'] = password

target = atool.getActionInfo('user/login')['url']
options['login_url'] = '%s' % target

email_from_name = ptool.getProperty('email_from_name')
options['signature'] = email_from_name

headers = {}
headers['Subject'] = _(u'${portal_title}: Your Membership Information',
                      mapping={'portal_title': decode(ptool.title(), script)})
headers['From'] = '%s <%s>' % (email_from_name,
                               ptool.getProperty('email_from_address'))
headers['To'] = '<%s>' % email

mtext = context.registered_email_template(**decode(options, script))
return makeEmail(mtext, script, headers)