コード例 #1
0
ファイル: project_notif.py プロジェクト: AthinaB/synnefo
def application_notify(application, action):
    recipients, subject, template = APPLICATION_DATA[action](application)
    try:
        build_notification(
            SENDER, recipients, subject,
            template=template,
            dictionary={'object': application}
        ).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #2
0
ファイル: project_notif.py プロジェクト: antonis-m/synnefo
def project_reinstatement_notify(project):
    try:
        build_notification(
            SENDER,
            [project.application.owner.email],
            _(messages.PROJECT_REINSTATEMENT_SUBJECT) % project.__dict__,
            template='im/projects/project_reinstatement_notification.txt',
            dictionary={'object': project}
        ).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #3
0
ファイル: project_notif.py プロジェクト: salsa-dev/synnefo
def project_unsuspension_notify(project):
    try:
        build_notification(
            SENDER,
            [project.application.owner.email],
            _(messages.PROJECT_UNSUSPENSION_SUBJECT) % project.__dict__,
            template='im/projects/project_unsuspension_notification.txt',
            dictionary={'object': project}
        ).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #4
0
def application_notify(application, action):
    recipients, subject, template = APPLICATION_DATA[action](application)
    try:
        build_notification(SENDER,
                           recipients,
                           subject,
                           template=template,
                           dictionary={
                               'object': application
                           }).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #5
0
ファイル: project_notif.py プロジェクト: salsa-dev/synnefo
def project_termination_notify(project):
    app = project.application
    try:
        build_notification(
            SENDER,
            [project.application.owner.email],
            _(messages.PROJECT_TERMINATION_SUBJECT) % app.__dict__,
            template='im/projects/project_termination_notification.txt',
            dictionary={'object': project}
        ).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #6
0
ファイル: project_notif.py プロジェクト: AthinaB/synnefo
def membership_request_notify(project, requested_user, action):
    owner = project.owner
    if owner is None:
        return
    subject, template = MEMBERSHIP_REQUEST_DATA[action](project)
    try:
        build_notification(
            SENDER, [owner.email], subject,
            template=template,
            dictionary={'object': project, 'user': requested_user.email}
        ).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #7
0
ファイル: project_notif.py プロジェクト: AthinaB/synnefo
def project_notify(project, action):
    owner = project.owner
    if owner is None:
        return
    subject, template = PROJECT_DATA[action](project)
    try:
        build_notification(
            SENDER, [owner.email], subject,
            template=template,
            dictionary={'object': project}
        ).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #8
0
def project_notify(project, action):
    owner = project.owner
    if owner is None:
        return
    subject, template = PROJECT_DATA[action](project)
    try:
        build_notification(SENDER, [owner.email],
                           subject,
                           template=template,
                           dictionary={
                               'object': project
                           }).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #9
0
def membership_request_notify(project, requested_user, action):
    owner = project.owner
    if owner is None:
        return
    subject, template = MEMBERSHIP_REQUEST_DATA[action](project)
    try:
        build_notification(SENDER, [owner.email],
                           subject,
                           template=template,
                           dictionary={
                               'object': project,
                               'user': requested_user.email
                           }).send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #10
0
def membership_enroll_notify(project, user):
    try:
        notification = build_notification(
            SENDER, [user.email],
            MEM_ENROLL_NOTIF['subject'] % project.__dict__,
            template=MEM_ENROLL_NOTIF['template'],
            dictionary={'object': project})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #11
0
ファイル: project_notif.py プロジェクト: salsa-dev/synnefo
def application_submit_notify(application):
    try:
        notification = build_notification(
            SENDER, NOTIFY_RECIPIENTS,
            _(messages.PROJECT_CREATION_SUBJECT) % application.__dict__,
            template='im/projects/project_creation_notification.txt',
            dictionary={'object': application})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #12
0
ファイル: project_notif.py プロジェクト: AthinaB/synnefo
def membership_enroll_notify(project, user):
    try:
        notification = build_notification(
            SENDER,
            [user.email],
            MEM_ENROLL_NOTIF['subject'] % project.__dict__,
            template=MEM_ENROLL_NOTIF['template'],
            dictionary={'object': project})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #13
0
ファイル: project_notif.py プロジェクト: AthinaB/synnefo
def membership_change_notify(project, user, action):
    try:
        notification = build_notification(
            SENDER,
            [user.email],
            MEM_CHANGE_NOTIF['subject'] % project.__dict__,
            template=MEM_CHANGE_NOTIF['template'],
            dictionary={'object': project, 'action': action})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #14
0
ファイル: project_notif.py プロジェクト: salsa-dev/synnefo
def membership_request_notify(project, requested_user):
    try:
        notification = build_notification(
            SENDER,
            [project.application.owner.email],
            _(messages.PROJECT_MEMBERSHIP_REQUEST_SUBJECT) % project.__dict__,
            template='im/projects/project_membership_request_notification.txt',
            dictionary={'object': project, 'user': requested_user.email})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #15
0
ファイル: project_notif.py プロジェクト: salsa-dev/synnefo
def membership_change_notify(project, user, action):
    try:
        notification = build_notification(
            SENDER,
            [user.email],
            MEM_CHANGE_NOTIF['subject'] % project.__dict__,
            template=MEM_CHANGE_NOTIF['template'],
            dictionary={'object': project, 'action': action})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #16
0
ファイル: project_notif.py プロジェクト: salsa-dev/synnefo
def application_approve_notify(application):
    try:
        notification = build_notification(
            SENDER,
            [application.owner.email],
            _(messages.PROJECT_APPROVED_SUBJECT) % application.__dict__,
            template='im/projects/project_approval_notification.txt',
            dictionary={'object': application})
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #17
0
ファイル: project_notif.py プロジェクト: grnet/synnefo
def application_approved_admins_notify(application, previous_state):
    recipients = []
    for name, mail in list(settings.PROJECT_NOTIFICATIONS_RECIPIENTS):
        recipients.append(mail)

    try:
        notification = build_notification(
            SENDER,
            recipients,
            APPLICATION_APPROVED_NOTIF['subject'].format(application.chain.name),
            template=APPLICATION_APPROVED_NOTIF['template'],
            dictionary={
                'application': application,
                'previous_state': previous_state
            }
        )
        notification.send()
    except NotificationError, e:
        logger.error(e.message)
コード例 #18
0
ファイル: project_notif.py プロジェクト: kins299/mycloud
def application_approved_admins_notify(application, previous_state):
    recipients = []
    for name, mail in list(settings.PROJECT_NOTIFICATIONS_RECIPIENTS):
        recipients.append(mail)

    try:
        notification = build_notification(
            SENDER,
            recipients,
            APPLICATION_APPROVED_NOTIF['subject'].format(
                application.chain.name),
            template=APPLICATION_APPROVED_NOTIF['template'],
            dictionary={
                'application': application,
                'previous_state': previous_state
            })
        notification.send()
    except NotificationError, e:
        logger.error(e.message)