Post office template extensions
Review usage examples of dynamic content and JavaScript code that can be entered on the Post Office page.
Subject
Identity Manager: You have <POGetNumOfEmails/> work items requiring your attention.
Plaintext body
You have <POGetNumOfEmails/> work items requiring your attention. The emails are all addressed to: <POGetEmailAddress/> Here are the email Subjects: <POGetAllSubjects/> Here are the email bodies: <POGetAllBodies/> Here is the topic fetched using the JavaScript extension: <JS> return PostOffice.getTopic(); </JS> Here is the recipient's email address fetched using the JavaScript extension: <JS> return PostOffice.getEmailAddress(); </JS> Here are the email text bodies fetched using the JavaScript extension: <JS> var msgListIterator = PostOffice.getAllEmailMessages().iterator(); var returnString = "\n"; while (msgListIterator.hasNext()) { returnString = returnString + msgListIterator.next().getMessage() + "\n"; } return returnString; </JS> Here is the recipient's surname taken from the Person fetched using the JavaScript extension: <JS> var person = PostOffice.getPersonByEmailAddress(PostOffice.getEmailAddress()); return "Last: " + person.getProperty("sn")[0] + "\n"; </JS>
XHTML body
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>You have <POGetNumOfEmails/> work items requiring your attention.</title> </head> <body> <POGetNumOfEmails/> notifications have been collected by Identity Manager Post Office and aggregated below. These indicate we can have up to <POGetNumOfEmails/> work items requiring your attention.<br /> The notifications were all addressed to: <POGetEmailAddress/><br /> <hr /> Here are the notification Subjects:<br /> <POGetAllSubjects/><br /> <hr /> Here are the notification bodies: <br /> <POGetAllBodies/><br /> <hr /> Here is the topic fetched using the JavaScript extension: <JS> return PostOffice.getTopic(); </JS> <br /> Here is the email address fetched using the JavaScript extension: <JS> return PostOffice.getEmailAddress(); </JS> <br /> Here are the email text bodies fetched using the JavaScript extension: <JS> var msgListIterator = PostOffice.getAllEmailMessages().iterator(); var returnString = "<br />"; while (msgListIterator.hasNext()) { returnString = returnString + msgListIterator.next().getMessage() + "<br />"; }return returnString; </JS> <br /> Here is the recipient's surname taken from the Person fetched using the JavaScript extension: <JS> var person = PostOffice.getPersonByEmailAddress(PostOffice.getEmailAddress()); return "<br />Last: " + person.getProperty("sn")[0] + "<br />"; </JS> <hr /> Please take care of these right away. Have a nice day !<br /> IT Dept </body> </html>Parent topic: Post office configuration