NotifyNow - getPreferredEmailAddress(GlideRecord user)

Get a user's preferred email address

Table 1. Parameters
Name Type Description
user GlideRecord or String The user record or the sys_id of a user to get the email address from.
Table 2. Returns
Type Description
String The email address or null.

var userID = "some user sys id";
var email = new SNC.NotifyNow().getPreferredEmailAddress(userID);
gs.log('the preferred email address for sending email notifications is ' + email + ' for user with id: ' + userID);