function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robert Wambold 10Robert Wambold 10 

Apex Trigger to send email with dynamic table of Case information

Hello all,

I have an Apex Trigger that fires when a custom check box field ( Freeze_User__c ) on the User object is updated. The process will set UserLogin.IsFrozen = true, Update Contact record, and send an email to the User's Manager if the User is owner of any Open Cases.

I have a request to include a table of Open Case information or a link to each Open Case.

I know I can build a List of Open Cases, but how do I display the data in a Dynamic Table?

I found a link  "Generate Collection Report" that uses GenerateCustomReport action to generate a chunk of HTML suitable for adding to the Body of an email action that supports rich text, like Send Rich Email.

https://unofficialsf.com/convert-record-data-into-tables-for-email-automation-with-generate-collection-report/

Has anyone used this action in an Apex Trigger?

Thanks for looking and offering assitance.

Best regards,

Robert