When notification is on record updated and inserted it creates a "notification_engine.process" event and when this event is processed and sys_email record is created, it is created as system and as system doesn't have the Encruption context role therefore it doesn't pulls the data of the Encryption field while building the Email body.

NOTE: The encryption here is not via Edge Encryption but via Platform Encryption.


We can use the following workaround to send out encrypted field info in the Outbound email: 

1. Create your own event (eg. "incident.encrypt") in the Event registry on the target table (eg. "incident" )
2. Based on your requirement, create an "After" insert/update Business Rule on the same target table (i.e. incident) and under the Advanced script create the Event and push the Encrypted field in any of the parm fields. Please see the screenshot attached.

 gs.eventQueue("incident.encrypt", current, current.caller_id,current.getDisplayValue('u_encrypted_field')); 

NOTE: The above example will get the decrypted value of the encrypted field (eg. u_encrypted_field) in the parm 2 of the event. 

3. Create the notification on When to Run as "Event is fired" and set the Event name as the event created on step 1. You can call the parm 2 in the Email body or subject by using: ${event.parm1} OR ${event.parm2} 

NOTE: This will help to pull the encrypted field data from the parm fields of the event in the Email Body.


Article Information

Last Updated:2019-08-02 20:58:23