Problem
The only way to identify which messages were sent using a specific template is to pattern-match the message body against stored templates, which is fragile and does not scale reliably.
Request
Add a template_id field to the messages table (or a separate mapping table) so each message sent via a template is directly linked to the template used, enabling accurate template usage analysis.
Your idea is now live and open for voting.