Getting database values for triggered emails

I’ve designed 4 triggered email templates that will be sent out based on conditions selected by a user on our form. Because of the conditional nature of the emails being sent and needing to access db field values I assume triggered emails are the way to go here (vs Automations or Send Grid).

Wix Automations will allow you to include values from a data collection in an email after a successful payment is processed but how would I access the same fields for triggered emails?

All the documentation/tutorials for triggered emails only show user input elements from a page/form. What about special functions that write to a db like order numbers, pickup codes or payment IDs?

Perhaps this post can help you somehow…
https://www.wix.com/velo/forum/coding-with-velo/contacting-site-member-directly-p2p?appSectionParams=%7B%22origin%22%3A%22member_posts_page%22%7D