Name
global.EmailUtils
Description
Utility class for parsing emails; provides helper function that determines if VCAL calendar invitation is present in body of email message.
Script
var EmailUtils = Class.create();
EmailUtils.prototype = {
initialize: function() {
},
containsCalendarInvite: function(/* com.glide.notification.Email */ email) {
// Cheap way of parsing for VCAL attachment: look for BEGIN:VCALENDAR followed by END:VCALENDAR
var vCalBeginIndex_text = email.body_text.toLowerCase().indexOf('begin:vcalendar');
var vCalEndIndex_text = email.body_text.toLowerCase().indexOf('end:vcalendar');
if (vCalBeginIndex_text > -1 && vCalEndIndex_text > vCalBeginIndex_text)
return true;
else
return false;
},
type: 'EmailUtils'
}
Sys ID
8301c23b9723100031af390ddd2975e3