This seems to be standard that the literal token {contact.display_name} is saved not the generated result "John Doe".

To my mind this is useless - the data changes - so how can I view the actual letter emailed or printed?

And what is the point of saving the template if it only contains the tokens - you could up saving thousands of identical templates none of which contain any useful information.

Is there a way I can save the generated content inside civiCRM?

  • are you talking about what is saved in the Activity that is created for when an Email (one to one) is sent?
    – petednz - fuzion
    Oct 29, 2019 at 19:13

1 Answer 1


The feature seems to be available just it seems very few components use it. For example if you do a contribution search and then choose to send thank you letters from the actions dropdown, it DOES convert the tokens in the filed activity on the contact.

In the code if the caller of this function includes the $perContactHtml parameter, then the activities get filed with the tokens converted: https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Contact/Form/Task/PDFLetterCommon.php#L278

The contribution one does do that, e.g. https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Contribute/Form/Task/PDFLetterCommon.php#L127

and here is where it resolves the tokens: https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Contribute/Form/Task/PDFLetterCommon.php#L431

But it seems most of them don't and so it uses the default which is just the verbatim text.

  • I do think that is really odd behaviour, I can't understand the rationale. Still, if $perContactHTML is available in contributions then I guess it is possible to do it elsewhere as well. Nov 1, 2019 at 13:50
  • I don't think it's intentional, just the way the software has evolved and it's just a matter of someone doing or sponsoring the work. As a workaround for emails you can set up the email processor (docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/…) and include the special email processor email address as a bcc recipient which will file the actual email in civi.
    – Demerit
    Nov 1, 2019 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.