5

I'm creating an email template to be used to confirm a contact's membership status, and I would like to include a list of the Groups (representing Committees in our case) that the contact belongs to.

I have tried including the token {contact.Group(s)} (with various capitalizations, inclusion of parentheses, etc.) without success.

I can include a token that sends the user to the form where they can see and edit those memberships, but I would rather just list them. I thought this would just be in the drop-down list of tokens, but no, and I can't find any reference to this in the manuals. Any suggestions?

Thanks as always. I'm using CiviCRM for WordPress, current versions.

4

As far as I know, that token doesn't exist, in core or in an extension. It's not a bad idea though; it would be quick to write. As with most tokens that list multiple fields, the real trick is in formatting. Some will want them in a particular order; some want them comma-separated vs. each on their own line, etc.

| improve this answer | |
4

As said by Jon its not available in core or in an extension. You can either write extension and implement hook_civicrm_tokens and hook_civicrm_tokenValues to add and generate token for the contact or you can use smarty with the help of Civi api

eg:

{capture assign=contactId}{contact.contact_id}{/capture}
{crmAPI var='result' entity='GroupContact' action='get' sequential=0 contact_id=$contactId status="Added"}

{foreach from=$result.values item=groupcontact}
  {$groupcontact.title}</br>
{/foreach}

HTH

Pradeep

| improve this answer | |
  • I admit I do not have any idea how to implement what you suggest. I think I will need to pay a developer to write the extensions and explain to me how to implement them. – David Hyman Apr 12 at 21:21
  • While at it, we have other things we might like to include in an email template, re the contact's Membership (the most recent, presumably, if there are someday more than one membership per person) : Either the "Member since" date -- or ideally that date plus ninety days. Anyone want to offer to help me with that? And what should I expect to pay? Is this an appropriate place to recruit for that? Thanks! – David Hyman Apr 12 at 21:29
  • 1
    Both Jon and Pradeep could do a good job, and I think Jon is an independent contractor these days. You might want to consider civicrm.org/extensions/civitoken and have the groups token be added to that extension. You might also be interested in civicrm.org/extensions/related-membership-tokens though it's not exactly what you want. Rates and hours vary. Maybe indicate your email as name (at) domain (dot) com or whatever and then ask people to contact you. – Joe Murray Apr 14 at 19:38
  • @JoeMurray I can't see the CiviToken extension. Did you mean civicrm.org/extensions/fuzion-tokens? – William Mortada May 18 at 16:19
  • Yes, Fuzion tokens are also known as Civi tokens extension – Pradeep Nayak May 18 at 16:20

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.