Tips for Maintaining Workflow templates

Published
2025-05-08 21:10
Written by
Eileen - member of the CiviCRM community and Core Team member - about the Core Team

Since the middle of last year there have been some tools in CiviCRM core to help with maintaining workflow templates that have not been well publicised … Notably Site Tokens (worked on at the South Carolina Sprint by Allen Shaw of Joinery) and some tweaks for easier editing in the Message Admin extension (which ships as part of CiviCRM but which you may need to enable). 

1 Site tokens

(docs link)

Under Communications->Site tokens your site will have a token called ‘message_header’

By default it has no data but add some html (you can leave the text part blank). I asked ChatGPT to write me some html…

And pasted it in….

Then when you use any of the uncustomised workflow templates your header will now be at the top of it because the {site.message_header} token is at the top of almost all the templates that ship with core. (The exception is the invoice template which is more table based than the others). 

If you have customised your workflow template then you might need to add the `{site.message_header}` token back in to get the header. Many sites only customise the header so this can remove the need to customise workflow templates

Here is the preview where you can see our message header at the top….

It’s also possible to add your own site tokens - eg. here I have added a second one - which I can now use in any email by adding `{site.invoice_header}`

Note there is one gotcha…. When you go to add a new token the form doesn’t currently enforce the format but you need to leave the spaces out!

2 Message Admin

The message admin extension has shipped with core for a while and it has supported previewing messages for a while - but it was hard to spot. Since mid last year the preview button is more obvious and there is a new Show Diff button - this uses the same widget that is used in Better Message Templates extension (which has some additional features).

When you click on ‘Show diff’ it will highlight the ways in which your template is different from the one that ships with core - and the somewhat hidden feature here is that if you click on the red text you get the option to ‘revert this change’ - ie switch back to the core CiviCRM template.

I will let ChatGPT have the last word