The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

9

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


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

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.


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

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


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


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

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


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


3

I ran into a similar issue of custom tokens not populating for scheduled reminders. The workaround in Brian Shaughnessy's comment on CRM-11153 fixed it for me: early in tokenValues put: $single = false; if (!is_array($contactIDs)) { $contactIDs = array( $contactIDs ); $origValues = $values; $single = true; } then at the very bottom put: ...


3

If you can produce a test for the email, and the token is replaced by the field value, then you might have a permission issue. It might be buried deeply, but see which role your Cron user has. Be sure the "CiviCRM - access all custom data" is on for your Cron user.


3

You will need to create a custom token for this. Hook_civicrm_tokens is where you assign names to your tokens, and hook_civicrm_tokenValues is where you define the business logic. You will use the API to retrieve the custom field values for each contact, and loop through those values to build your HTML table. Below is an example of the basic API call, for ...


3

I have custom data fields, and they are 'multi-value' sets (e.g. employment history; John has 3 prior jobs attached to his contact profile.) These data elements are not currently available by default in CiviCRM. In order for me to be able to use these custom data elements in CiviMail, I had to write a bit of code in a Drupal Module to implement the proper '...


3

We have done this with {membership.owner}, which works for the email that goes to the main contact (with inherited membership) and the organization email. E.g. TestOrg’s membership is due for renewal //// {membership.owner}’s membership is due for renewal


3

I have had success in differentiating content based on the value of a custom field by enabling Smarty for message templates http://wiki.civicrm.org/confluence/display/CRMDOC46/Smarty+in+mail+templates


3

Tim - If the timezone for the event is always the one used by your organization (for example, if you're located in New York, it's always ET), you could modify the Smarty template for event receipts to include the time zone in the date formatting. One example: {$event.event_start_date|crmDate} could become {$event.event_start_date|date_format:"%A, %B %e, ...


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