Changeset View
Changeset View
Standalone View
Standalone View
wallace/module_resources.py
Show First 20 Lines • Show All 1,349 Lines • ▼ Show 20 Lines | if notify or not success: | ||||
msg['To'] = owner['mail'] | msg['To'] = owner['mail'] | ||||
msg['From'] = resource['mail'] | msg['From'] = resource['mail'] | ||||
msg['Date'] = formatdate(localtime=True) | msg['Date'] = formatdate(localtime=True) | ||||
msg['Subject'] = utils.str2unicode(_('Booking for %s has been %s') % ( | msg['Subject'] = utils.str2unicode(_('Booking for %s has been %s') % ( | ||||
resource['cn'], participant_status_label(status) if success else _('failed') | resource['cn'], participant_status_label(status) if success else _('failed') | ||||
)) | )) | ||||
modules._sendmail(resource['mail'], owner['mail'], msg.as_string()) | result = modules._sendmail(resource['mail'], owner['mail'], msg.as_string()) | ||||
log.debug(_("Owner notification was sent successfully: %r") % result, level=8) | |||||
def owner_notification_text(resource, owner, event, success): | def owner_notification_text(resource, owner, event, success): | ||||
organizer = event.get_organizer() | organizer = event.get_organizer() | ||||
status = event.get_attendee_by_email(resource['mail']).get_participant_status(True) | status = event.get_attendee_by_email(resource['mail']).get_participant_status(True) | ||||
if success: | if success: | ||||
message_text = _(""" | message_text = _(""" | ||||
The resource booking for %(resource)s by %(orgname)s <%(orgemail)s> has been %(status)s for %(date)s. | The resource booking for %(resource)s by %(orgname)s <%(orgemail)s> has been %(status)s for %(date)s. | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |