Hot answers tagged

11

Yes it is possible to include custom contact fields for individuals in messages sent by CiviMail by just selecting the custom field from the list of tokens. The help on the Insert Token widget for CiviMail explains how to do it for custom organizational contacts, and the same process works for custom household fields as well: Custom tokens (based on ...


8

My understanding is that Lobo's answer above is slightly misleading (at least if you read it 100% literally--the gist what he is saying is exactly correct, as usual, but the exact terminology may lead some of us astray). The contact hash is a value stored in the civicrm_contact table of the database (i.e., civicrm_contact.hash). The contact hash is used ...


7

You can change your organization address by going to Administer > Communications > Organization Address and contact info. Alternatively and less recommended,you can disable the check for mandatory tokens in CiviMail by going to: Administer > Civimail > Civimail component settings


7

These two extensions should assist - https://civicrm.org/extensions/contact-checksum-ui https://civicrm.org/extensions/fancy-tokens The second extension provides tokens for all active contribution pages and active events with online registration enabled.


6

The setting you're looking for is here: Administer menu > System Settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.) The second option is "checksum lifespan".


6

Domain tokens are not replaced when trying to send email activity for a contact. This seems like a bug in civicrm or wrong documentation. This can be fixed by applying below patch. diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 787a1c955d..35133010e1 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity....


6

This is a bit tricky to answer, because there are three different token processors in CiviCRM. The Smarty processor, the legacy token processor, and the new Civi\TokenProcessor processor. Legacy Processor (aka CRM_Utils_Token) For most messages - quick emails, PDFs, etc. - you're using the legacy token processor. You can find most of these tokens in ...


5

Option 1: Use the CiviToken extension [recommended, CMS independent]: Fuzion's CiviToken extension provides {user.name} and {user.id} tokens by default. (Pro tip: this module also makes it easy to add custom tokens in a tokens/ folder in your CiviCRM custom PHP directory; you can duplicate and modify a file from the tokens/ folder in this extension) Option ...


5

Yes contact hashes are regenerated every time they are created. the microtime is embedded in the contact hash. Contact hashes have a specific life time (by default, this is 7 days). So they are invalid after 7 days


5

No, there is no token for base URL is available in civicrm. If you want to use base URL in templates, you can try this: // Declare $config; $config = & CRM_Core_Config::singleton(); $baseUrl = $config->userFrameworkBaseURL; This will gives you base URL and use variable "$baseUrl" in your template. Another way is, you can create your custom ...


5

I think this would be a custom token to get it in the format that you're looking for, but it wouldn't be too difficult and I am pretty sure you'll be able to find one someone has already written - Check out the bottom two links of this page: https://forum.civicrm.org/index.php?topic=13757.0 The last post April 29: "We discovered at the sprint that just ...


5

In order to get smarty to work in email templates you need to enable it editing the settings file civicrm.settings.php, as per CiviCRM documentation: if (!defined('CIVICRM_MAIL_SMARTY')) { define( 'CIVICRM_MAIL_SMARTY', 1 ); // default is: define( 'CIVICRM_MAIL_SMARTY', 0 ); } With smarty enabled, the following snippet should output the desired date ...


5

In order to use legal_name against your message template the best way would be enabling CIVICRM_MAIL_SMARTY to 1 in civicrm_setting.php By doing this you can access {contact.legal_name} in your message template I did made a test against Version 4.7.15 which worked. so please give a try Reference: https://wiki.civicrm.org/confluence/display/CRMDOC/Smarty+in+...


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

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

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

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 short answer is "not without extensions". It would be difficult, for instance, to say exactly which of a contact's many contributions you want to pull data from. That said, other users have created extensions that give you many of the most commonly needed tokens. Check out the Summary Fields, Contributions Table, and Eileen's custom tokens, in that ...


4

Eileen did an extension that added some membership tokens to deal with contacts having multiple membership and which do work from 'contact' {latestcurrentmembership.end_date} {latestcurrentmembership.allend_date} https://civicrm.org/extensions/nzcofuzioncivitoken please let us know how you get on with it


4

The issue isn't 100% clear because your formatting doesn't allow me to perfectly understand which tokens have a line break after them and which have a space - but I'm pretty sure I know what's going on. By default, if a token evaluates to NULL and there is NOTHING else on that line, the line will be omitted entirely when producing address labels. However, ...


4

Here's an attempt to address this with a token that can be used with Fuzion's CiviToken extension. With that extension installed, this token file can be added to a tokens directory in your custom PHP folder to provide a "Latest Contrib Soft Credit Name" token. (It checks the latest contribution and if there is a soft credit adds the name(s) in this token). ...


4

You could create a custom token and add the format you want. An example of such a token in a custom format (a long with lots of other tokens) you could find in the extension no.maf.tokens This extension contains specific tokens for a client and one of the tokens in the date of today in Norwegian. See https://github.com/CiviCooP/org.civicoop.no.maf.ext/blob/...


4

I thought I had tried the obvious but must have had a typo. It is there but it isn't listed in the list of tokens. It's {contribution.financial_type}. Should it be listed? If so, it looks like a bug. It didn't take much make it show. In my test version I hacked SelectValues.php and added financial type to the contribution token array. If I looked at ...


4

Tapash, I've just tested this myself and I've had success with including the fieldset within the token so that it looks something like the following: [submission:values:civicrm_1_contact_1_fieldset_fieldset:civicrm_1_contact_1_contact_first_name] You'll want to update the above if you've customised any of the keys or are using a different contact!


4

Any chance you don't have smarty enabled for civiMail so your capture-assigns and ifs aren't working in the mail? Try checking your civicrm.settings.php file and look for the line define( 'CIVICRM_MAIL_SMARTY', 1 ); as per https://backofficethinking.com/blog/tip-how-personalize-emails-civicrm. If you don't find it, or if it's set to 0, you'll need to add/...


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 ...


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.


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='...


3

in CiviCRM 4.6.2 you can patch this issue with the following edit: --- a/a/civicrm-core/CRM/Mailing/BAO/Mailing.php +++ b/b/civicrm-core/CRM/Mailing/BAO/Mailing.php @@ -1472,7 +1472,7 @@ ORDER BY civicrm_email.is_bulkmail DESC if ($this->url_tracking) { $data = CRM_Mailing_BAO_TrackableURL::getTrackerURL($token, $this->id, $...


3

It sounds like the hook isn't being called (or not called correctly) when processing the update_greeting job. I think that qualifies as a bug and you could file it in issues.civicrm.org. But due to the high volume of issues, a core team member may not be available to jump on it anytime soon. I'd suggest you keep on with your debugging and compare the code ...


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