def leaveLink(self): b = '''Hello, Please remove me from {groupInfo.name} <{groupInfo.url}> Thank you.''' body = b.format(groupInfo=self.groupInfo) retval = mailto(self.email, 'Unsubscribe', body) return retval
def email(self): subject = 'Hidden file' b = '''Hello, I wanted to see the file <{0}>. However, it is hidden. I think I should be allowed to see the file because...''' body = b.format(self.requested) retval = mailto(self.siteInfo.get_support_email(), subject, body) return retval
def digestLink(self): b = """Hello, Please switch me from receiving one email per post to the daily digest, which summarises the all the posts made each day in {groupInfo.name} <{groupInfo.url}> Thank you.""" body = b.format(groupInfo=self.groupInfo) retval = mailto(self.email, "Digest on", body) return retval
def unsupportedEmail(self): m = '''Hi, I would like to invite some people to join my group, {groupInfo.name}: {groupInfo.url} However, the Invite by CSV page does not support my browser. Could you please invite the people for me? I have attached a CSV file below.''' msg = m.format(groupInfo=self.groupInfo) subject = 'Invite by CSV Unsupported' retval = mailto(self.siteInfo.get_support_email(), subject, msg) return retval
def update(self): super(HiddenPostViewlet, self).update() postId = self.manager.post['post_id'] self.hiddenPostInfo = HiddenPostInfo(self.context, postId) subject = 'Hidden post' b = '''Hello, I was viewing a post that is hidden in {groupInfo.name} on {siteInfo.name} <{siteInfo.url}/r/post/{postId}> and...''' body = b.format(groupInfo=self.groupInfo, siteInfo=self.siteInfo, postId=postId) self.hiddenSupportEmail = mailto(self.siteInfo.get_support_email(), subject, body)
def mailto(toAddress, subject, body): '''Create a ``mailto`` URI .. current-module: gs.content.email.base :param str toAddress: The address for the ``mailto``. :param str subject: The subject for the email. :param str body: The body of the message. :returns: A string that starts with ``mailto:`` and contains the parameters :rtype: str It is very common to put links with complex ``mailto`` URIs in notifications. These ``mailto`` links normally are directed at the email address for the support group for the site, and contain information that will be useful in the support group, such as links to the profile of the person who received the notification, and links back to the relevant group. Actually just a wrapper for :func:`gs.core.mailto`, added to this class for convinence.''' retval = mailto(toAddress, subject, body) return retval