Add Zapier notification agent

This commit is contained in:
JonnyWong16 2018-02-01 22:11:33 -08:00
parent de6b6e8124
commit 304378f93b
3 changed files with 159 additions and 16 deletions

View file

@ -3200,6 +3200,16 @@ class WebInterface(object):
logger.warn(msg)
return msg
@cherrypy.expose
@cherrypy.tools.json_out()
@requireAuth(member_of("admin"))
def zapier_test_hook(self, zapier_hook='', **kwargs):
success = notifiers.ZAPIER(config={'hook': zapier_hook})._test_hook()
if success:
return {'result': 'success', 'msg': 'Test Zapier webhook sent.'}
else:
return {'result': 'error', 'msg': 'Failed to send test Zapier webhook.'}
@cherrypy.expose
@requireAuth(member_of("admin"))
def set_notification_config(self, **kwargs):