diff --git a/doc/3.3-macros.md b/doc/3.3-macros.md index eb90e6941..2a9ece1b4 100644 --- a/doc/3.3-macros.md +++ b/doc/3.3-macros.md @@ -135,10 +135,10 @@ users: Name | Description -----------------------|-------------- - CONTACTNAME | The name of the user object. - CONTACTALIAS | The value of the display_name attribute. - CONTACTEMAIL | This is an alias for the *email* macro. - CONTACTPAGER | This is an alias for the *pager* macro. + USERNAME | The name of the user object. + USERDISPLAYNAME | The value of the display_name attribute. + USEREMAIL | This is an alias for the *email* macro. + USERPAGER | This is an alias for the *pager* macro. ### Global Macros diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index f46bf0778..2356f6ce9 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -313,7 +313,7 @@ Example: object NotificationCommand "mail-service-notification" inherits "plugin-notification-command" { command = [ "/opt/bin/send-mail-notification", - "$CONTACTEMAIL$", + "$USEREMAIL$", "$NOTIFICATIONTYPE$ - $HOSTNAME$ - $SERVICEDESC$ - $SERVICESTATE$", {{{***** Icinga ***** diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index 3ab163816..22f19bfd5 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -126,18 +126,18 @@ double User::GetLastNotification(void) const bool User::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *result) const { - if (macro == "CONTACTNAME") { + if (macro == "USERNAME" || macro == "CONTACTNAME") { *result = GetName(); return true; - } else if (macro == "CONTACTALIAS") { + } else if (macro == "USERDISPLAYNAME" || macro == "CONTACTALIAS") { *result = GetDisplayName(); return true; } else { String tmacro; - if (macro == "CONTACTEMAIL") + if (macro == "USEREMAIL" || macro == "CONTACTEMAIL") tmacro = "email"; - else if (macro == "CONTACTPAGER") + else if (macro == "USERPAGER" || macro == "CONTACTPAGER") tmacro = "pager"; else tmacro = macro;