def mail_i18n(object, event):
    """Send an i18n email when an object gets 'i18n' in the title.

    A bit silly perhaps, but this tests mails in a different encoding.
    """
    if 'i18n' in object.Title():
        watchers = IWatcherList(object)
        watchers.send('i18n-mail')
Пример #2
0
def mail_issue_add(object, event):
    """Send an email when a new issue is created
    """
    if object.modified() != object.created():
        return
    if object.getReviewState()['state'] == 'unconfirmed':
        watchers = IWatcherList(object)
        watchers.send('new-issue-mail')
Пример #3
0
def mail_issue_add(object, event):
    """Send an email when a new issue is created
    """
    if object.modified() != object.created():
        return
    if object.getReviewState()['state'] == 'unconfirmed':
        watchers = IWatcherList(object)
        watchers.send('new-issue-mail')
Пример #4
0
def mail_issue_change(object, event):
    """Send an email when an issue is resolved
    """
    if event.new_state.id == 'resolved':
        watchers = IWatcherList(object)
        # Only mail the original poster, if available.
        address = object.getContactEmail()
        if address:
            watchers.send('resolved-issue-mail',
                          only_these_addresses=[address])
Пример #5
0
def mail_issue_change(object, event):
    """Send an email when an issue is resolved
    """
    if event.new_state.id == 'resolved':
        watchers = IWatcherList(object)
        # Only mail the original poster, if available.
        address = object.getContactEmail()
        if address:
            watchers.send('resolved-issue-mail',
                          only_these_addresses=[address])
Пример #6
0
def mail_issue_change(object, event):
    """Send an email on some transitions of an issue.

    Specifically: new issue and resolved issue.
    """
    if event.transition and event.transition.id == 'post':
        watchers = IWatcherList(object)
        watchers.send('new-issue-mail')
    elif event.new_state.id == 'resolved':
        watchers = IWatcherList(object)
        # Only mail the original poster, if available.
        address = object.getContactEmail()
        if address:
            watchers.send('resolved-issue-mail',
                          only_these_addresses=[address])
Пример #7
0
def mail_issue_change(object, event):
    """Send an email on some transitions of an issue.

    Specifically: new issue and resolved issue.
    """
    if event.transition and event.transition.id == 'post':
        watchers = IWatcherList(object)
        watchers.send('new-issue-mail')
    elif event.new_state.id == 'resolved':
        watchers = IWatcherList(object)
        # Only mail the original poster, if available.
        address = object.getContactEmail()
        if address:
            watchers.send('resolved-issue-mail',
                          only_these_addresses=[address])
def added_response(claim, event):
    """Send message to people involved in the claim when it is created or
    modified.
    """
    ombudsoffice = aq_parent(claim)
    watchers = IWatcherList(claim)
    # clear the list of watchers to deal with any change
    watchers.watchers = []

    # add the email for the responsible area, if exists
    emails = ombudsoffice.get_emails_for_areas()
    email = emails.get(claim.area)
    if email:
        watchers.watchers.append(email)

    # add the email of the owner of the claim
    watchers.watchers.append(claim.email)

    watchers.send('claim-mail')
def send_closed_task_mail(task):
    watchers = IWatcherList(task)
    watchers.send('closed-task-mail')
def send_task_notification_mail(task):
    watchers = IWatcherList(task)
    watchers.send('new-task-mail')
def send_response_notification_mail(task):
    watchers = IWatcherList(task)
    watchers.send('new-response-mail')
Пример #12
0
def sendResponseNotificationMail(issue):
    # As we take the last response by default, we can keep this simple.
    watchers = IWatcherList(issue)
    watchers.send('new-response-mail')
Пример #13
0
def sendResponseNotificationMail(issue):
    # As we take the last response by default, we can keep this simple.
    watchers = IWatcherList(issue)
    watchers.send('new-response-mail')
Пример #14
0
def mail_news(object, event):
    """Send an email when a news item is published.
    """
    if event.new_state.id == 'published':
        watchers = IWatcherList(object)
        watchers.send('newsitem-mail')