Created
March 15, 2017 17:43
-
-
Save beckettkev/8325e2f7044c3f6a0ba39a3c4d623c1d to your computer and use it in GitHub Desktop.
Get an individuals Alerts - SPO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ctx = SP.ClientContext.get_current(); | |
this.user = ctx.get_web().get_currentUser(); | |
this.alerts = this.user.get_alerts(); | |
ctx.load(this.user); | |
ctx.load(this.alerts); | |
ctx.executeQueryAsync(()=> { | |
var enumerator = this.alerts.getEnumerator(); | |
while(enumerator.moveNext()) { | |
var l = enumerator.get_current(); | |
console.log(l.get_title()); | |
/* | |
If you now load the list, you can get this information to... | |
this.list = l.get_list(); | |
ctx.load(this.list); | |
ctx.executeQueryAsync(() => { | |
console.log(' ' + l.get_list()); | |
}, (e, t)=> { }); | |
*/ | |
console.log(' Delivery Channels: ' + l.get_deliveryChannels()); | |
console.log(' Event Type: ' + l.get_eventType()); | |
console.log(' Always Notify: ' + l.get_alwaysNotify()); | |
} | |
}, ()=> { | |
console.log('WORSE THAN EGGS!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment