def notify(self, design, user): """ Notify the design's user that they need to register their email with gravatar. """ url = self.request.host_url recipient = user.email sender = self.settings['moderator_email_address'] subject = self._(u'Complete your WikiHouse profile with a gravatar') body = u'%s\n\n%s %s\n%s %s/library/designs/%s\n\n%s\n\n%s%s\n\n%s\nWikiHouse\n%s\n' % ( self._(u'Your design has been approved and included in the WikiHouse library:'), self._(u'Title:'), xhtml_escape(design.title), self._(u'Url:'), url, design.key().id(), self._(u'To complete your user profile and have your design featured, register a profile image against your email address here:'), 'http://en.gravatar.com/site/signup/', urllib.quote(user.email), self._(u'Thanks,'), url ) message = mail.EmailMessage( to=recipient, sender=sender, subject=subject, body=body ) message.send()
def _send_notification(self, design): """ Notify the user and moderators that a design has been queued for moderation. """ url = self.request.host_url user = users.get_current_user() recipient = user.email() sender = self.settings['moderator_email_address'] subject = self._(u'New design submitted to WikiHouse') body = u'%s\n\n%s %s\n%s %s/library/designs/%s\n\n%s\nWikiHouse\n%s\n' % ( self._(u'Your design has been queued for moderation:'), self._(u'Title:'), xhtml_escape(design.title), self._(u'Url:'), url, design.key().id(), self._(u'Thanks,'), url ) message = mail.EmailMessage( to=recipient, sender=sender, subject=subject, body=body ) message.send()
def _send_notification(self, design): """ Notify the user and moderators that a design has been queued for moderation. """ url = self.request.host_url user = users.get_current_user() recipient = user.email() sender = self.settings['moderator_email_address'] subject = self._(u'New design submitted to WikiHouse') body = u'%s\n\n%s %s\n%s %s/library/designs/%s\n\n%s\nWikiHouse\n%s\n' % ( self._(u'Your design has been queued for moderation:'), self._(u'Title:'), xhtml_escape(design.title), self._(u'Url:'), url, design.key().id(), self._(u'Thanks,'), url) message = mail.EmailMessage(to=recipient, sender=sender, subject=subject, body=body) message.send()
def notify(self, design, user): """ Notify the design's user that they need to register their email with gravatar. """ url = self.request.host_url recipient = user.email sender = self.settings['moderator_email_address'] subject = self._(u'Complete your WikiHouse profile with a gravatar') body = u'%s\n\n%s %s\n%s %s/library/designs/%s\n\n%s\n\n%s%s\n\n%s\nWikiHouse\n%s\n' % ( self. _(u'Your design has been approved and included in the WikiHouse library:' ), self._(u'Title:'), xhtml_escape( design.title), self._(u'Url:'), url, design.key().id(), self. _(u'To complete your user profile and have your design featured, register a profile image against your email address here:' ), 'http://en.gravatar.com/site/signup/', urllib.quote( user.email), self._(u'Thanks,'), url) message = mail.EmailMessage(to=recipient, sender=sender, subject=subject, body=body) message.send()
def render(self, tmpl_name, **kwargs): return u'<h2>%s</h2><p>%s</p><p>%s</p>' % ( tmpl_name, xhtml_escape(unicode(kwargs)), xhtml_escape(unicode(self.settings)) )
def render(self, tmpl_name, **kwargs): return u'<h2>%s</h2><p>%s</p><p>%s</p>' % ( tmpl_name, xhtml_escape( unicode(kwargs)), xhtml_escape(unicode(self.settings)))