CA Service Management

SPEL: HTML styled notification via SPEL 

Jun 12, 2015 07:12 AM

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.

Algoritm:

    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
                        "cnt:98F9B596B29349439597C90C17903F46
",                             // 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!

Statistics
0 Favorited
36 Views
1 Files
0 Shares
6 Downloads
Attachment(s)
zip file
z_crt_ntf.spl.zip   1 KB   1 version
Uploaded - May 29, 2019

Related Entries and Links

No Related Resource entered.