本文整理汇总了Python中MaKaC.webinterface.mail.GenericNotification类的典型用法代码示例。如果您正苦于以下问题:Python GenericNotification类的具体用法?Python GenericNotification怎么用?Python GenericNotification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GenericNotification类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, psList):
self._psList = psList
self._participationsByConf = self._calculateParticipationsByConf()
self._forceIndicoFromAddress = len(self._participationsByConf) > 1
data = {}
data["subject"] = "[Indico] User account creation required"
data["toList"] = [self._psList[0].getEmail()]
GenericNotification.__init__(self, data)
示例2: __init__
def __init__(self, booking):
GenericNotification.__init__(self)
self._booking = booking
self._bp = booking._bookingParams
self._conference = booking.getConference()
self._modifLink = str(booking.getModificationURL())
self.setFromAddr("Indico Mailer<%s>"%HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail())
self.setContentType("text/html")
示例3: __init__
def __init__(self, booking):
GenericNotification.__init__(self)
self._booking = booking
self._bp = booking.getBookingParams()
self._conference = booking.getConference()
self._isLecture = self._conference.getType() == 'simple_event'
self._modifLink = str(booking.getModificationURL())
self.setFromAddr("Indico Mailer<%s>"%Config.getInstance().getSupportEmail())
self.setContentType("text/html")
示例4: __init__
def __init__(self, booking):
GenericNotification.__init__(self)
self._booking = booking
self._bp = booking._bookingParams
self._conference = booking.getConference()
self._modifLink = str(self._booking.getModificationURL())
self.setFromAddr("Indico Mailer <%s>"%Config.getInstance().getSupportEmail())
self.setToList(MailTools.getAdminEmailList())
self.setContentType("text/html")
示例5: __init__
def __init__(self, user, judgement, contribution):
GenericNotification.__init__(self)
self.setFromAddr("Indico Mailer<%s>"%HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail())
self.setToList([user.getEmail()])
if isinstance(judgement, EditorJudgement):
self.setSubject("""[Indico] The layout of your contribution "%s" (id: %s) has been reviewed"""
% (contribution.getTitle(), str(contribution.getId())))
self.setBody("""Dear Indico user,
The layout of your contribution "%s" (id: %s) has been reviewed.
The judgement was: %s
The comments of the editor were:
"%s"
Thank you for using our system.
""" % ( contribution.getTitle(), str(contribution.getId()), judgement.getJudgement(),
judgement.getComments())
)
elif isinstance(judgement, ReviewerJudgement):
self.setSubject("""[Indico] The content of your contribution "%s" (id: %s) has been reviewed"""
% (contribution.getTitle(), str(contribution.getId())))
self.setBody("""Dear Indico user,
The content of your contribution "%s" (id: %s) has been reviewed.
The judgement was: %s
The comments of the reviewer were:
"%s"
Thank you for using our system.
""" % ( contribution.getTitle(), str(contribution.getId()), judgement.getJudgement(),
judgement.getComments())
)
elif isinstance(judgement, RefereeJudgement):
self.setSubject("""[Indico] Your contribution "%s" (id: %s) has been completely reviewed by the referee"""
% (contribution.getTitle(), str(contribution.getId())))
self.setBody("""Dear Indico user,
Your contribution "%s" (id: %s) has been completely reviewed by the assigned referee.
The judgement was: %s
The comments of the referee were:
"%s"
Thank you for using our system.
""" % ( contribution.getTitle(), str(contribution.getId()), judgement.getJudgement(),
judgement.getComments())
)
示例6: __init__
def __init__(self, user, role, conference):
GenericNotification.__init__(self)
self.setFromAddr("Indico Mailer <%s>" % Config.getInstance().getNoReplyEmail())
self.setToList([user.getEmail()])
self.setSubject("""[Indico] You have been removed as %s of the conference "%s" (id: %s)"""
% (role, conference.getTitle(), str(conference.getId())))
self.setBody("""Dear Indico user,
We are sorry to inform you that you have been removed as %s of the conference "%s" (id: %s).
Thank you for using our system.
""" % ( role, conference.getTitle(), str(conference.getId())
))
示例7: sendAndLog
def sendAndLog(cls, notification, conference, module=None, user=None, skipQueue=False):
if isinstance(notification, dict):
# Wrap a raw dictionary in a notification class
from MaKaC.webinterface.mail import GenericNotification
notification = GenericNotification(notification)
cls.send(notification, skipQueue=skipQueue)
log_data = {
u"content_type": to_unicode(notification.getContentType()),
u"from": to_unicode(notification.getFromAddr()),
u"to": map(to_unicode, notification.getToList()),
u"cc": map(to_unicode, notification.getCCList()),
u"bcc": map(to_unicode, notification.getBCCList()),
u"subject": to_unicode(notification.getSubject()).strip(),
u"body": to_unicode(notification.getBody()).strip(),
}
summary = u"Sent email: {}".format(log_data[u"subject"])
conference.log(
EventLogRealm.emails,
EventLogKind.other,
to_unicode(module or u"Unknown"),
summary,
user,
type_=u"email",
data=log_data,
)
示例8: __init__
def __init__(self, user, role, conference):
GenericNotification.__init__(self)
self.setFromAddr("Indico Mailer <%s>" % Config.getInstance().getNoReplyEmail())
self.setToList([user.getEmail()])
self.setSubject("""You have been chosen as a %s for the conference "%s" """
% (role, conference.getTitle()))
self.setBody("""Dear %s,
You have been chosen as a %s for the conference entitled "%s" in order to help with the paper reviewing process. Please find the Paper Reviewing utilities here:
%s
Kind regards,
Indico on behalf of "%s"
""" % ( user.getStraightFullName(), role, conference.getTitle(), urlHandlers.UHPaperReviewingDisplay.getURL(conference), conference.getTitle()))
示例9: __init__
def __init__(self, user, role, contribution):
GenericNotification.__init__(self)
conference = contribution.event_new.as_legacy
self.setFromAddr("Indico <%s>" % Config.getInstance().getNoReplyEmail())
self.setToList([user.email])
self.setSubject("""You are no longer a %s of a paper for "%s" """ % (role, conference.getTitle()))
self.setBody("""Dear %s,
Please, be aware that you are no longer a %s of the paper entitled "%s" (id: %s) for the conference "%s":
%s
Kind regards,
Indico on behalf of "%s"
""" % ( user.full_name, role, contribution.title, str(contribution.friendly_id), conference.getTitle(), str(urlHandlers.UHConferenceDisplay.getURL(conference)), conference.getTitle()))
示例10: __init__
def __init__(self, task):
GenericNotification.__init__(self)
self.setFromAddr("Indico <%s>" % Config.getInstance().getNoReplyEmail())
self.setToList([task.avatar.getEmail()])
self.setSubject("""
The offline version of the event "%s" is ready to be downloaded
""" % (task.conference.getTitle()))
self.setBody("""
Dear %s,
The offline version for the event "%s" was successfully generated and it is ready to be downloaded.
Download link: %s
Best Regards,
--
Indico""" % (task.avatar.getStraightFullName(), task.conference.getTitle(), task.getDownloadLink()))
示例11: __init__
def __init__(self, maxDate, previousTotal, newTotal, error = None, attainedDate = None):
GenericNotification.__init__(self)
self.setFromAddr("Indico Mailer <%s>" % Config.getInstance().getSupportEmail())
self.setContentType("text/html")
self.setToList(MailTools.getAdminEmailList('Vidyo'))
serverTimezone = info.HelperMaKaCInfo.getMaKaCInfoInstance().getTimezone()
if error:
self.setSubject("""[Vidyo] Old room cleaning failed: %s rooms deleted"""
% str(previousTotal - newTotal))
self.setBody("""Dear Vidyo Manager,<br />
<br />
A cleanup of old Vidyo rooms in <a href="%s">%s</a> encountered the following error:%s<br />
"All rooms before %s (%s, server timezone) should have been deleted but only the date %s was reached.<br />
There were %s rooms before the operation and there are %s rooms left now.<br />
""" % (MailTools.getServerName(),
MailTools.getServerName(),
escape(str(error)),
formatDateTime(getAdjustedDate(maxDate, tz=serverTimezone)),
serverTimezone,
formatDateTime(getAdjustedDate(attainedDate, tz=serverTimezone)),
str(previousTotal),
str(newTotal)))
else:
self.setSubject("""[Vidyo] Old room cleaning successful: %s rooms deleted"""
% str(previousTotal - newTotal))
self.setBody("""Dear Vidyo Manager,<br />
<br />
A cleanup was successfully executed for old Vidyo rooms in <a href="%s">%s</a>.<br />
All rooms attached to events finishing before %s (%s, server timezone) were deleted in the Vidyo server.<br />
There were %s rooms before the operation and there are %s rooms left now.<br />
""" % (MailTools.getServerName(),
MailTools.getServerName(),
formatDateTime(getAdjustedDate(maxDate, tz=serverTimezone)),
serverTimezone,
str(previousTotal),
str(newTotal)))
示例12: sendAndLog
def sendAndLog(cls, notification, conference, module=None, user=None, skipQueue=False):
from indico.modules.events.logs import EventLogRealm, EventLogKind
if isinstance(notification, dict):
# Wrap a raw dictionary in a notification class
from MaKaC.webinterface.mail import GenericNotification
notification = GenericNotification(notification)
cls.send(notification, skipQueue=skipQueue)
log_data = {
u'content_type': to_unicode(notification.getContentType()),
u'from': to_unicode(notification.getFromAddr()),
u'to': map(to_unicode, notification.getToList()),
u'cc': map(to_unicode, notification.getCCList()),
u'bcc': map(to_unicode, notification.getBCCList()),
u'subject': to_unicode(notification.getSubject()).strip(),
u'body': to_unicode(notification.getBody()).strip()
}
summary = u'Sent email: {}'.format(log_data[u'subject'])
conference.log(EventLogRealm.emails, EventLogKind.other, to_unicode(module or u'Unknown'), summary, user,
type_=u'email', data=log_data)
示例13: __init__
def __init__(self, room, userList):
GenericNotification.__init__(self)
self.setFromAddr("Indico Mailer <%s>"%Config.getInstance().getSupportEmail())
self.setToList(userList)
示例14: __init__
def __init__(self, sendToList, fromEmail, fromName ="Indico Mailer"):
GenericNotification.__init__(self)
self.setContentType("text/html")
self.setFromAddr("%s<%s>"%(fromName, fromEmail))
self.setToList(sendToList)