Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Get level of notification in Cpanel::iContact::Provider::Example

Discussion in 'cPanel Developers' started by nicoalonsop, Aug 25, 2017.

  1. nicoalonsop

    nicoalonsop Registered

    Joined:
    Jul 10, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Uruguay
    cPanel Access Level:
    Root Administrator
    Hi, Im creating a Custom Server Notification for Slack and i cant find how can i get the level of importance of the notification inside the Provider Module. I need it to put different colors.

    Can anyone help me?

    Thanks in advance.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,533
    Likes Received:
    37
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hi,

    We don't currently include the notification level in the notification object :( I'll file a case to have that added.
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,533
    Likes Received:
    37
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Case CPANEL-15504 was filed to include the notification priority.

    It is currently possible to use the human-friendly form of the notification priority by accessing CPANEL.module_event_importance_description in your template. That provides a textual form of the level, which may be localized. I've requested we provide the numerical form along with the human-friendly version.
     
  4. Bruno Morais

    Bruno Morais Registered

    Joined:
    Jan 6, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Portugal
    cPanel Access Level:
    Root Administrator
    Hi @nicoalonsop,
    Did you manage to make this module notification?
    I'm also trying to do it. The Schema part is done but for Provider I cant make tests on the module. In the WHM Contact Manager Tab In the Slack there is no test link. Perl is not my best language.
    Could you please give some help?

    Thanks,
    Regards,
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,533
    Likes Received:
    37
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hi Bruno,

    As of cPanel & WHM version 68, the base notification class provides a notification_priority function. That function returns the numerical value of the notification importance.
     
Loading...

Share This Page