Example #1
0
def _send_to_chat(msg, url_path):
    """Send a message to the main room/channel for active chat integrations."""
    try:
        app_settings = models.AppSettings.get()
    except ValueError:
        logging.warning('Not sending to chat: app settings not configured')
        return

    msg = "%s %s%s" % (msg, app_settings.hostname, url_path)

    hipchat_room = app_settings.hipchat_room
    if hipchat_room:
        hipchatlib.send_to_hipchat_room(hipchat_room, msg)

    slack_channel = app_settings.slack_channel
    if slack_channel:
        slacklib.send_to_slack_channel(slack_channel, msg)
Example #2
0
def _send_to_chat(msg, url_path):
    """Send a message to the main room/channel for active chat integrations."""
    try:
        app_settings = models.AppSettings.get()
    except ValueError:
        logging.warning('Not sending to chat: app settings not configured')
        return

    msg = "%s %s%s" % (msg, app_settings.hostname, url_path)

    hipchat_room = app_settings.hipchat_room
    if hipchat_room:
        hipchatlib.send_to_hipchat_room(hipchat_room, msg)

    slack_channel = app_settings.slack_channel
    if slack_channel:
        slacklib.send_to_slack_channel(slack_channel, msg)
Example #3
0
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Weekly snippets are ready!'
            ' http://weekly-snippets.appspot.com/weekly')
     hipchatlib.send_to_hipchat_room('Khan Academy', msg)
Example #4
0
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Reminder: Weekly snippets due today at 5pm.'
            ' http://weekly-snippets.appspot.com/')
     hipchatlib.send_to_hipchat_room('Khan Academy', msg)
Example #5
0
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Weekly snippets are ready! '
            '<a href="http://macaulay-snippets.appspot.com/weekly">'
            'http://macaulay-snippets.appspot.com/weekly</a>')
     hipchatlib.send_to_hipchat_room('Macaulay Honors College', msg)
Example #6
0
 def _send_to_hipchat(self):
     """Sends a note to the main hipchat room."""
     msg = ('Reminder: Weekly snippets due today at 5pm. '
            '<a href="http://macaulay-snippets.appspot.com/">'
            'http://macaulay-snippets.appspot.com/</a>')
     hipchatlib.send_to_hipchat_room('Macaulay Honors College', msg)
Example #7
0
def _send_to_chat(msg):
    """Sends a message to the main room/channel for active chat integrations."""
    if _SEND_TO_HIPCHAT:
        hipchatlib.send_to_hipchat_room('Khan Academy', msg)
    if _SEND_TO_SLACK:
        slacklib.send_to_slack_channel('#khan-academy', msg)