]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/ui/default/opac/test_notification.js
lp1777677 Security tweaks
[Evergreen.git] / Open-ILS / web / js / ui / default / opac / test_notification.js
1 function sendTestEmail(user_id, authtoken) {
2     sendTestNotification(user_id, 'au.email.test', authtoken);
3 }
4
5 function sendTestSMS(user_id, authtoken) {
6     sendTestNotification(user_id, 'au.sms_text.test', authtoken);
7 }
8
9 function sendTestNotification(user_id, hook, authtoken) {
10
11     var args = {
12         target: user_id,
13         hook: hook
14     };
15
16     new OpenSRF.ClientSession('open-ils.actor').request({
17         method: 'open-ils.actor.event.test_notification',
18         params: [authtoken, args],
19         oncomplete: function(r) {
20             var resp = r.recv();
21             if (resp) {
22                 var banner = document.getElementById('test_notification_banner');
23                 banner.style.display = 'table-row';
24             }
25         }
26     }).send();
27 }