Commit 3829d62a authored by Bastien Ho's avatar Bastien Ho :alien:
Browse files

Manage contribution_url token

parent 422fbd87
No related merge requests found
Showing with 31 additions and 4 deletions
+31 -4
......@@ -133,7 +133,7 @@ class CRM_Cartable_CivirulesActions_SendEmailForPayments extends CRM_Civirules_A
];
$sent = CRM_Core_BAO_MessageTemplate::sendTemplate($params);
Civi::log()->debug("Cartable: Reçu de contribution contact. sent", $sent);
// Civi::log()->debug("Cartable: Reçu de contribution contact. sent", $sent);
}
if (isset($syndicateEmails) && isset($syndicateEmails[0]['email'])) {
......
......@@ -1223,7 +1223,6 @@ function cartable_evaluate_tokens(\Civi\Token\Event\TokenValueEvent $e)
if(empty($usedTokens['SUD'])){
return;
}
Civi::log()->debug('Cartable: Used tokens ', $usedTokens);
// Compute contact_ids
$contacts = [];
......@@ -1296,14 +1295,16 @@ function cartable_evaluate_tokens(\Civi\Token\Event\TokenValueEvent $e)
}
}
}
Civi::log()->debug('Cartable: indexed_memberships tokens ', $indexed_memberships);
}
// FIND contribution URL
if(
in_array('contribution_url', $usedTokens['SUD'])
){
// Todo: manage SUD.contribution_url in settings
$profileUrl = civicrm_api4('Setting', 'get', ['select' => ['cartable_profile_url',], 'checkPermissions' => false]);
foreach($cids as $cid){
$contacts[$cid]['contribution_url'] = $profileUrl[0]['value'];
}
}
// FIND most recent SEPA Mandates (per contact)
......
......@@ -81,6 +81,32 @@ return [
],
],
],
'cartable_profile_url' => [
'name' => 'cartable_profile_url',
'type' => 'String',
'description' => E::ts('URL of profile page'),
'default' => '',
'title' => E::ts('URL of profile page'),
'html_type' => 'Text',
'settings_pages' => [
'cartable' => [
'weight' => 190,
],
],
],
'cartable_join_url' => [
'name' => 'cartable_join_url',
'type' => 'String',
'description' => E::ts('URL of membership page'),
'default' => '',
'title' => E::ts('URL of join page'),
'html_type' => 'Text',
'settings_pages' => [
'cartable' => [
'weight' => 200,
],
],
],
'cartable_sud_documentation_url' => [
'name' => 'cartable_sud_documentation_url',
'type' => 'String',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment