本文整理汇总了Python中MaKaC.webinterface.mail.GenericMailer.sendAndLog方法的典型用法代码示例。如果您正苦于以下问题:Python GenericMailer.sendAndLog方法的具体用法?Python GenericMailer.sendAndLog怎么用?Python GenericMailer.sendAndLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.webinterface.mail.GenericMailer
的用法示例。
在下文中一共展示了GenericMailer.sendAndLog方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: askForExcuse
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def askForExcuse(self, eventManager, toIdList):
data = self.prepareAskForExcuse(eventManager,toIdList)
if data is None :
return False
GenericMailer.sendAndLog(GenericNotification(data),self._conference,"participants",eventManager)
return True
示例2: notify
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def notify(self,registrant,params):
if params.has_key("conf"):
GenericMailer.sendAndLog(self.apply(registrant,params),
params["conf"],
'Registration')
else:
GenericMailer.send(self.apply(registrant,params))
示例3: notify
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def notify(self,registrant,params):
if params.has_key("conf"):
GenericMailer.sendAndLog(self.apply(registrant,params),
params["conf"],
log.ModuleNames.REGISTRATION)
else:
GenericMailer.send(self.apply(registrant,params))
示例4: setStatusDeclined
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def setStatusDeclined(self, responsibleUser=None, sendMail=True):
if self._status != "pending" :
return False
self._status = "declined"
logData = self.getParticipantData()
logData["subject"] = _("%s : status set to DECLINED")%self.getWholeName()
self.getConference().getLogHandler().logAction(logData,"participants",responsibleUser)
if sendMail:
data = {}
data["fromAddr"] = info.HelperMaKaCInfo.getMaKaCInfoInstance().getSupportEmail()
confTitle = self._participation.getConference().getTitle()
data["subject"] = _("Your application for attendance in %s declined")%confTitle
toList = []
toList.append(self._email)
title = ""
if self._title == "" or self._title is None :
title = self._firstName
else:
title = self._title
data["toList"] = toList
data["body"] = _("""
Dear %s %s,
your request to attend the %s has been declined by the event manager.
Your Indico
""")%(title, self._familyName, confTitle)
GenericMailer.sendAndLog(GenericNotification(data),self.getConference(),"participants",responsibleUser)
return True
示例5: askForExcuse
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def askForExcuse(self, eventManager, toIdList):
data = self.prepareAskForExcuse(eventManager, toIdList)
if data is None :
return False
GenericMailer.sendAndLog(GenericNotification(data), self._conference,
log.ModuleNames.PARTICIPANTS)
return True
示例6: notifyAll
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def notifyAll(self,params):
subj=params.get("subject","")
b=params.get("body","")
fa=params.get("from","")
tl=params.get("to",[])
cc = params.get("cc",[])
notification = Notification(subject=subj,body=b,fromAddr=fa,toList=tl,ccList=cc)
if params.has_key("conf"):
GenericMailer.sendAndLog(notification, params["conf"])
else:
GenericMailer.send(notification)
示例7: addParticipant
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def addParticipant(self, participant, eventManager = None):
# check if it's worth to add the participant
if participant.getConference().getId() != self._conference.getId() :
return False
self.removePendingParticipant(participant)
if not participant.setId(self._newParticipantId()):
return False
if self.alreadyParticipating(participant) != 0 :
return False
self._participantList["%d"%self._lastParticipantId()] = participant
# remove him from the "pending" list
if participant in self._pendingParticipantList.values() :
for k in self._pendingParticipantList.keys() :
if self._pendingParticipantList[k] == participant :
del self._pendingParticipantList[k]
break
logData = participant.getParticipantData()
logData["subject"] = _("New participant added : %s")%participant.getWholeName()
self._conference.getLogHandler().logAction(logData,
log.ModuleNames.PARTICIPANTS)
participant.setStatusAdded()
# check if an e-mail should be sent...
if self._addedInfo :
# to notify the user of his/her addition
if eventManager is None :
return False
data = self.prepareAddedInfo(participant, eventManager)
GenericMailer.sendAndLog(GenericNotification(data),
self._conference,
log.ModuleNames.PARTICIPANTS)
avatar = participant.getAvatar()
if avatar is None :
# or to encourage him/her to register at Indico
#self.sendEncouragementToCreateAccount(participant)
pass
else:
# OK, if we have an avatar, let's keep things consistent
avatar.linkTo(self._conference,"participant")
self.notifyModification()
return True
示例8: addParticipant
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def addParticipant(self, participant, eventManager = None):
# check if it's worth to add the participant
if participant.getConference().getId() != self._conference.getId() :
return False
self.removePendingParticipant(participant)
if not participant.setId(self._newParticipantId()):
return False
if self.alreadyParticipating(participant) != 0 :
return False
self._participantList["%d"%self._lastParticipantId()] = participant
# remove him from the "pending" list
if participant in self._pendingParticipantList.values() :
for k in self._pendingParticipantList.keys() :
if self._pendingParticipantList[k] == participant :
del self._pendingParticipantList[k]
break
self.getConference().log(EventLogRealm.management, EventLogKind.positive, u'Participants',
u'Participant added: {}'.format(to_unicode(participant.getName())),
session.user, data=participant.getParticipantData())
participant.setStatusAdded()
# check if an e-mail should be sent...
if self._addedInfo :
# to notify the user of his/her addition
if eventManager is None :
return False
data = self.prepareAddedInfo(participant, eventManager)
GenericMailer.sendAndLog(GenericNotification(data),
self._conference,
'Participants')
avatar = participant.getAvatar()
if avatar is None :
# or to encourage him/her to register at Indico
#self.sendEncouragementToCreateAccount(participant)
pass
else:
# OK, if we have an avatar, let's keep things consistent
avatar.linkTo(self._conference,"participant")
self.notifyModification()
return True
示例9: sendSpecialEmail
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def sendSpecialEmail(self, participantsIdList, eventManager, data):
if participantsIdList is None :
return False
if eventManager is None :
return False
if len(participantsIdList) == 0:
return True
if data.get("subject",None) is None :
return False
if data.get("body",None) is None :
return False
data["fromAddr"] = eventManager.getEmail()
toList = []
for id in participantsIdList :
participant = self._participantList.get(id,None)
if Participant is not None :
toList.append(p.getEmail())
data["toList"] = toList
GenericMailer.sendAndLog(GenericNotification(data),self._conference,"participants",eventManager)
return True
示例10: sendEncouragementToCreateAccount
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def sendEncouragementToCreateAccount(self, participant):
if participant is None :
return False
if participant.getEmail() is None or participant.getEmail() == "" :
return None
data = {}
title = participant.getTitle()
if title is None or title == "" :
title = participant.getFirstName()
createURL = urlHandlers.UHUserCreation.getURL()
data["fromAddr"] = Config.getInstance().getNoReplyEmail()
toList = []
toList.append(participant.getEmail())
data["toList"] = toList
data["subject"] = _("Invitation to create an Indico account")
data["body"] = _("""
Dear %s %s,
You have been added as a participant to '%s' and you have started to use
the Indico system. Most probably you are going to use it in the future,
participating in other events supported by Indico.
Therefore we strongly recommend that you create your personal Indico Account -
storing your personal data it will make your work with Indico easier and
allow you access more sophisticated features of the system.
To proceed in creating your Indico Account simply click on the following
link : %s
Please use this email address when creating your account: %s
Your Indico
""")%(participant.getFirstName(), participant.getFamilyName(), \
self._conference.getTitle(), \
createURL, participant.getEmail())
GenericMailer.sendAndLog(GenericNotification(data),self._conference,"participants")
return True
示例11: inviteParticipant
# 需要导入模块: from MaKaC.webinterface.mail import GenericMailer [as 别名]
# 或者: from MaKaC.webinterface.mail.GenericMailer import sendAndLog [as 别名]
def inviteParticipant(self, participant, eventManager):
if participant.getConference().getId() != self._conference.getId() :
return False
if not participant.setId(self._newParticipantId()):
return False
if eventManager is None :
return False
if self.alreadyParticipating(participant) != 0 :
return False
self._participantList["%d"%self._lastParticipantId()] = participant
logData = participant.getParticipantData()
logData["subject"] = _("New participant invited : %s")%participant.getWholeName()
self._conference.getLogHandler().logAction(logData,"participants",eventManager)
participant.setStatusInvited()
data = {}
title = ""
firstName = ""
familyName = ""
eventURL = urlHandlers.UHConferenceDisplay.getURL( self._conference )
actionURL = urlHandlers.UHConfParticipantsInvitation.getURL( self._conference )
actionURL.addParam("participantId","%d"%self._lastParticipantId())
toList = []
if participant.getAvatar() is not None :
toList.append(participant.getAvatar().getEmail())
data["toList"] = toList
title = participant.getAvatar().getTitle()
familyName = participant.getAvatar().getFamilyName()
firstName = participant.getAvatar().getFirstName()
else :
toList.append(participant.getEmail())
data["toList"] = toList
title = participant.getTitle()
familyName = participant.getFamilyName()
firstName = participant.getFamilyName()
locationName = locationAddress = ""
if self._conference.getLocation() is not None :
locationName = self._conference.getLocation().getName()
locationAddress = self._conference.getLocation().getAddress()
if data["toList"] is None or len(data["toList"]) == 0 :
return False
if title is None or title == "" :
title = firstName
data["fromAddr"] = eventManager.getEmail()
data["subject"] = _("Invitation to %s")%self._conference.getTitle()
data["body"] = _("""
Dear %s %s,
%s %s, event manager of '%s' would like to invite you to take part in this event,
which will take place on %s in %s, %s. Further information on this event are
available at %s
You are kindly requested to accept or decline your participation in this event by
clicking on the link below :
%s
Looking forward to meeting you at %s
Your Indico
on behalf of %s %s
""")%(title, familyName, \
eventManager.getFirstName(), eventManager.getFamilyName(), \
self._conference.getTitle(), \
self._conference.getAdjustedStartDate(), \
locationName, locationAddress, \
eventURL, actionURL, \
self._conference.getTitle(), \
eventManager.getFirstName(), eventManager.getFamilyName())
GenericMailer.sendAndLog(GenericNotification(data),self._conference,"participants")
#if participant.getAvatar() is None :
# self.sendEncouragementToCreateAccount(participant)
self.notifyModification()
return True