""" customize the email template called `name` """ ob_id = 'emailpt_%s' % name manage_addEmailPageTemplate(self, ob_id, email_templates[name]._text) ob = self._getOb(ob_id) if REQUEST is not None: REQUEST.RESPONSE.redirect(ob.absolute_url() + '/manage_workspace') else: return ob_id security.declareProtected(view_management_screens, 'manage_main') manage_main = folder_manage_main_plus security.declareProtected(view_management_screens, 'ny_after_listing') ny_after_listing = PageTemplateFile('zpt/customize_emailpt', globals()) ny_after_listing.email_templates = email_templates security.declareProtected(PERMISSION_PUBLISH_OBJECTS, 'download') def download(self, REQUEST=None, RESPONSE=None): """returns all the subscriptions in a csv file""" header = ['User', 'Location', 'Notification type', 'Language'] rows = [] for s in self.admin_get_subscriptions(): row = [] row.append(s['user']) if (s['location']): row.append(s['location']) else: row.append('entire portal')
def _get_template(self, name): template = self._getOb(name, None) if template is not None: return template.render_email template = email_templates.get(name, None) if template is not None: return template.render_email raise ValueError('template for %r not found' % name) security.declareProtected(view_management_screens, 'manage_customizeTemplate') def manage_customizeTemplate(self, name, REQUEST=None): """ customize the email template called `name` """ manage_addEmailPageTemplate(self, name, email_templates[name]._text) ob = self._getOb(name) if REQUEST is not None: REQUEST.RESPONSE.redirect(ob.absolute_url() + '/manage_workspace') else: return name customize_email_templates = PageTemplateFile('zpt/customize_emailpt', globals()) customize_email_templates.email_templates = email_templates InitializeClass(SurveyQuestionnaire)