code cleanup
authorKurund Jalmi <kurundjalmi@thirdsectordesign.org>
Sun, 17 Sep 2023 17:26:04 +0000 (18:26 +0100)
committerKurund Jalmi <kurundjalmi@thirdsectordesign.org>
Wed, 6 Dec 2023 00:23:33 +0000 (00:23 +0000)
ext/afform/core/Civi/Afform/Tokens.php
ext/afform/core/Civi/Api4/Action/Afform/Submit.php

index 5061a2718a371fb1a31efc1881c4e00a9c5de849..89d6f12a984a618b7aee81b4c9ea2e9a497efdb1 100644 (file)
@@ -64,9 +64,10 @@ class Tokens extends AutoService implements EventSubscriberInterface {
     foreach ($tokenForms as $tokenName => $afform) {
       $e->tokens['afform']["afform.{$tokenName}Url"] = E::ts('%1 (URL)', [1 => $afform['title'] ?? $afform['name']]);
       $e->tokens['afform']["afform.{$tokenName}Link"] = E::ts('%1 (Full Hyperlink)', [1 => $afform['title'] ?? $afform['name']]);
-      $e->tokens['afform']["afform.{$tokenName}ValidateSubmissionUrl"] = E::ts('%1 Validate Submission URL)', [1 => $afform['title'] ?? $afform['name']]);
-      $e->tokens['afform']["afform.{$tokenName}ValidateSubmissionLink"] = E::ts('%1 Validate Submission (Full Hyperlink)', [1 => $afform['title'] ?? $afform['name']]);
     }
+
+    $e->tokens['afform']["afform.validateSubmissionUrl"] = E::ts('Validate Submission URL)');
+    $e->tokens['afform']["afform.validateSubmissionLink"] = E::ts('Validate Submission (Full Hyperlink)');
   }
 
   /**
index 27c9557547b7f218046a16215011ed1e94294f26..a6024dd0504a7c12eff1acf1f92f90404184108c 100644 (file)
@@ -528,13 +528,13 @@ class Submit extends AbstractProcessor {
 
     // send email
     $emailParams = [
-      'id' => $this->_afform['email_confirmation_template_id'],
+      'messageTemplateID' => $this->_afform['email_confirmation_template_id'],
       'from' => "$domainEmailName <" . $domainEmailAddress . ">",
       'toEmail' => $emailAddress,
       'tokenContext' => $tokenContext,
     ];
 
-    civicrm_api3('MessageTemplate', 'send', $emailParams);
+    \CRM_Core_BAO_MessageTemplate::sendTemplate($emailParams);
   }
 
 }