I used to use a name personalisation in civimail with smarty script...

{capture assign=nickname}{contact.nick_name}{/capture} Dear {if $nickname}{contact.nick_name}{else}{contact.sort_name}{/if}

I was testing if this script would render in mosaico 2.x, it seems doesn't work. Is there any workaround? Thanks

  • Have you turned on SMARTY in civicrm.settings.php? – Pradeep Nayak Jul 24 '19 at 16:57
  • Smarty can be turned on. It won't help with mosaico. – netzih Jul 24 '19 at 17:00
  • yes, its turned on , and I was using with civimail – Tapash Jul 24 '19 at 17:00

As a workaround for the specific example in your post, you can create a custom token. This post explains how using hook_civicrm_tokens and hook_civicrm_tokenValues

  • Thanks. That’s how we have achieved our goal. – Tapash Jul 25 '19 at 9:30

I looked into it a while back. Seems mosaico is not compatible with smarty.

  • Thanks, is there a workaround? – Tapash Jul 24 '19 at 16:29
  • Not afaik. Would live to hear of one if you do find. – netzih Jul 24 '19 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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