This is a rough guide to fetching and displaying in an HTML Template email arbitrary data from a custom stored procedure via the Custom/Execute REST API endpoint.
NOTE: This may not be the best way to do things—edits, additions, and improvements to this document are very welcome.
In this example, we use a CUSTOMER_ORDERS stored procedure to include a summary of a constituent's recent orders in a Constituent Info template.