示例#1
0
def trigger_session_state_change_notifications(session,
                                               event_id,
                                               state=None,
                                               message=None,
                                               subject=None):
    if not state:
        state = session.state
    link = url_for('event_sessions.session_display_view',
                   event_id=event_id,
                   session_id=session.id,
                   _external=True)
    admin_msg_setting = DataGetter.get_message_setting_by_action(
        SESSION_ACCEPT_REJECT)
    for speaker in session.speakers:
        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(
            speaker.user_id, event_id)
        if not admin_msg_setting or \
            (email_notification_setting and email_notification_setting.session_accept_reject == 1 and
             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:

            if speaker.email:
                send_session_accept_reject(speaker.email,
                                           session.title,
                                           state,
                                           link,
                                           subject=subject,
                                           message=message)
            # Send notification
        if speaker.user:
            send_notif_session_accept_reject(speaker.user, session.title,
                                             state, link)
    session.state_email_sent = True
    from app.helpers.data import save_to_db
    save_to_db(session)
def trigger_session_state_change_notifications(session, event_id, state=None):
    if not state:
        state = session.state
    link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)
    for speaker in session.speakers:
        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)
        if email_notification_setting and email_notification_setting.session_accept_reject == 1:
            send_session_accept_reject(speaker.email, session.title, state, link)
            # Send notification
            send_notif_session_accept_reject(speaker.user, session.title, state, link)
def trigger_session_state_change_notifications(session, event_id, state=None):
    if not state:
        state = session.state
    link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)
    admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_ACCEPT_REJECT)
    for speaker in session.speakers:
        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)
        if not admin_msg_setting or \
                (email_notification_setting and email_notification_setting.session_accept_reject == 1 and
                    admin_msg_setting.user_control_status == 1) or \
                admin_msg_setting.user_control_status == 0:
            send_session_accept_reject(speaker.email, session.title, state, link)
            # Send notification
        send_notif_session_accept_reject(speaker.user, session.title, state, link)