Hot answers tagged

4

I'm assuming you have the civicrm_entity module installed. There's an open pull request for this at https://github.com/eileenmcnaughton/civicrm_entity/pull/238 If you're able to test out that patch and comment there on that PR it might get merged faster.


3

For the use case where the email is sent from a logged in user, one could use the function CRM_Core_Session::singleton()->getLoggedInContactID() to get the logged in contact ID. This would fall down for those cases where the email is generated by a 'system call', e.g. an email that was triggered by a cron job, but that might not be a deal breaker for your ...


2

I think you need to use hook_civicrm_buildAmount or hook_civicrm_buildForm hook to change the amount on front end contribution/event pages for priceset or line items.


1

Converted comment to answer: I think it's always been like this? And for editing an existing one it's not -1 it's the autoincrement id in the customvalue table.


1

You could use something like CRM_Core_Permission::check('administer CiviCRM') which returns true or false depending on if they have that permission.


1

Aidan is right about the intent of the hook that you're using. It's not really the right tool for the job. If "CiviRules is not an option" then you should look at the civicrm_pre and civicrm_post hooks. You can then use the CiviCRM API to retrieve any relevant Custom Field values for the Membership and take action based on what is returned. There ...


1

That hook is intended for overriding the effects of the membership status rules ('Current', 'Grace', 'Expired' etc). If you want to take action based on membership changes, try CiviRules


1

This doesn't fix the larger issue (see e.g. https://lab.civicrm.org/dev/core/-/issues/1709) but you can update your database to put the full name in the abbreviation field: alter table civicrm_state_province modify column abbreviation varchar(64) DEFAULT NULL; update civicrm_state_province s inner join civicrm_country c ON s.country_id = c.id SET s....


1

It should be like below // Not returning anything, the tags are not interpreted at all // function mailhooks_civicrm_tokenValues( &$values, &$contactIDs ) { foreach($contactIDs as $id){ $address = \Civi\Api4\Address::get() ->addSelect('street_address', 'supplemental_address_1', 'supplemental_address_2', 'supplemental_address_3', 'city',...


1

Those are Smarty templates, and don't use regular CiviCRM tokens - which is confusing because the tokens can look the same. Fortunately, Smarty is a full-fledged templating language. You can do date formatting pretty easily. I think you want this: {$smarty.now|date_format:"%Y"}


1

you need to create an extension and use the buildForm hook. More information on creating an extension can be found here: https://docs.civicrm.org/dev/en/latest/extensions/ More information on the buildForm hook: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/ This contains an example of adding a field. Another example of adding a field ...


1

Yes, some admin config forms doesn't invoke postProcess hook. Try below patch to invoke post process hook diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index 5f809f2..67cac30 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -309,6 +309,7 @@ class ...


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