Hot answers tagged

5

Simple answer: No. Those tokens are expanded into text strings by CiviMail for each recipient and your third party service is not going to know what values to substitute for those. Complex answer: Maybe. If your third party service has a way to allow you to provide tokens for substitution, and you can generate the correct data and format out of Civi then ...


5

This sounded like a useful feature, so I added Age tokens to Eileen's CiviTokens extension, which seems to be the most widely used extension of its kind. Until a new release comes out, you'll have to pull from the master branch of the git repo.


5

I don't see any either, but the code to use in such an extension (as either a token or even a smarty modifier) seems pretty straightforward: https://github.com/civicrm/civicrm-core/blob/5.19.2/CRM/Contact/BAO/Contact.php#L2677-L2684 if ($contact->birth_date) { $birthDate = CRM_Utils_Date::customFormat($contact->birth_date, '%Y%m%d'); ...


5

There are multiple "token" systems in CiviCRM depending on your context. {$totalAmount|crmMoney} is a Smarty token, which only works in Smarty emails. System Workflow messages are Smarty, traditional templates don't handle Smarty by default, but can; Mosaico templates don't support Smarty (by design). None of the approaches suggested above are without ...


4

The issue is that a contact can have multiple memberships, so you can't use membership tokens unless you display your search results as memberships. In Advanced Search, do your search again, but change Display Results As from Contacts to Memberships. If your contacts only have one membership each, this is all you need to do; if they can have multiple ...


3

First - no need to enable Smarty system-wide to do this. Greetings are always parsed by Smarty - see https://civicrm.org/blog/antrik/getting-started-with-new-name-and-greetings-features-in-45. Besides that, I think you're one of the leading experts on complex token extensions, since you're the primary author of reltoken. But I don't see why you couldn't ...


3

Davy, You can use CiviCRM api to fetch the custom fields of participants, contact and then use as smarty in your message template Something like this you can include in invoice template {crmAPI var='result' entity='ParticipantPayment' action='get' return="participant_id.contact_id.custom_3,participant_id.custom_4" contribution_id=$id} {assign var="...


3

You will need to turn on CIVICRM_MAIL_SMARTY in civicrm.settings.php to use smarty templating for conditional and more complex logic. Cheers Pradeep


2

{membership.start_date} was never supported in token list for sending mailings unless you have any custom extension or module that generates one. {membership.start_date} token is supported only in Schedule reminders(for memberships) or printing letters for membership.(i believe). The schedule reminder screen allows you to save the template so that it can ...


2

Can you try updating the version of flexmailer extension to latest from https://github.com/civicrm/org.civicrm.flexmailer? I think this problem was resolved via https://github.com/civicrm/org.civicrm.flexmailer/pull/33 and related PRs.


2

No that is not possible. The tokens in CiviCRM are used in letters/emails. So they are used for communication with the contacts in your database. Also note that a token in CiviCRM is always related to a contact.


2

I think I can self-answer this after exploring various methods to create end of the year thank-you letters for recurring/multiple contributions - the donation tokens are not passed in the $values array, and are not otherwise easily accessible from within the hook function. In theory it may be possible to access an array of contribution data passed in the ...


2

Can you try applying the patch from here? If it worked please comment the PR your test result for it to get merged.


2

You may want to have a look at this extenion: https://github.com/bjendres/de.systopia.newsstore It can collect/aggregate content in CiviCRM, e.g. from a RSS feed. Those items can then be sent out with CiviMail. With some additional extensions you could even sent them out automatically. I do not remember all the details and documentation is a bit sparse but ...


1

Try configuring your ck editor as provided here. Thanks Pradeep


1

You may find this provides the missing feature you need https://civicrm.org/extensions/nzcofuzioncivitoken


1

I think it's fair to say the new Civi\Token\TokenProcessor model is still evolving, but the older method still works and is the easier option for now unless it is not sufficient for your needs. You can find a range of extensions doing things with tokens here


1

You might be able to do something with Drupal Entities and Drupal Tokens. You would replace the default welcome emails with one created by rules. CiviCRM Tokens are used exclusively within CiviCRM. -Josh


1

Take a look at civirules, with the email api extension also enabled so that the action of sending an email is available. That might get you partly there. You can set rules for when events change or activities are added, which could trigger your email.


1

Thanks to Parvez, for pointing this out. As well as Mosaico we had the GDPR extension installed. Upgrading to latest version GDPR has fixed the issue!


1

Tapash, Unfortunately current_employer doesn't work for display even though the code is meant to handle. Solution: Submit a PR to handle for current employer. Use pre hook to alter the display name just before it is written into the database. HTH Pradeep


1

Since people are looking at this question, it's worth noting that you don't need to enable Smarty system-wide to do this for greetings. CiviCRM 4.5+ automatically handles Smarty in the greetings fields, see this blog post: https://civicrm.org/blog/antrik/getting-started-with-new-name-and-greetings-features-in-45


1

UPDATE - instead of the workaround have a look at the answer to this more recent question How to create tokens for custom fields (participant, individual, organisation)


1

This token {latestcontribs.financial_type} From this extension https://civicrm.org/extensions/nzcofuzioncivitoken works for the online receipt


1

This is posted as a comment in the top answer, but it deserves more visibility as an answer: You can install Fuzion's Civitoken extension.


Only top voted, non community-wiki answers of a minimum length are eligible