SPEL: HTML styled notification via SPEL

Document created by cdtj Champion on Jun 12, 2015Last modified by cdtj Champion on Nov 10, 2018
Version 3Show Document
  • View in full screen mode

Document is outdated!

More flexible solution was found: HTML Notifications in a context of custom object. by Karoliss


This doc is kept as example how animator_nxd could be used for customers purposes.


Original doc:

Today I wish to share my method, which gives possibility, to send html formatted notifications via SPEL.

I've used animator_nxd queue to make this trick works,

so I would be pleased to hear opinions on this and it will be great if someone else have animator customization/usage experience.


Why this is needed?

Generally CA SDM have possibility to send notification to any related contact object, OOTB or custom.

But what to do if contact or contacts list are not related with notified object?

For example our business have requirement to notify customers when CO is approved but list of customers is a LREL which filled on previous CO stage.

Here comes to help OOTB method called "notify_list" but it works only with plain text (as OOTB Manual notify function).


How this method works?

I have spent a lot of time in tries to premodify that plain text notification but it seems like all realtime notifications are performed by pdm_mail_nxd without any possibility to customize them.

So I have based my method on notification queue table.


    1. Create queued notification;

    2. Create animator to proceed recently created notification.


Usage example

notque::z_create_notify("<p>My <span style='color:red'>beautiful</span> <b>text</b> notification</p>", // HTML body here, 32768 symbols max

                        "RE: Header",                                                       // Notification header
",                             // recipient UUID
                        "chg:1337",                                                         // object persid
                        29,                                                                 // unknown, 28 for REQ/INC, 29 for others
                        2                                                                   // Notification level: 2 - Normal, 3 - High, etc.   


Entire code is attached as attachment,

any comments, tips and suggestions are welcome!