Answers.Body: <p>Yes, some admin config forms doesn't invoke postProcess hook. Try below patch to invoke post process hook</p>
  <pre><code>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 CRM_Admin_Form_MessageTemplates extends CRM_Core_Form {
         }
   
         $messageTemplate = MessageTemplate::save()-&gt;setDefaults($params)-&gt;setRecords([['id' =&gt; $this-&gt;_id]])-&gt;execute()-&gt;first();
  +      $this-&gt;postProcessHook();
         CRM_Core_Session::setStatus(ts('The Message Template \'%1\' has been saved.', [1 =&gt; $messageTemplate['msg_title']]), ts('Saved'), 'success');
   
         if (isset($this-&gt;_submitValues['_qf_MessageTemplates_upload'])) {
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-13T11:51:38.943Z
Answers.Text: Thanks! will test it!
Answers.UserDisplayName: Jan-Derek Vos
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-12T19:00:19.603Z
Answers.LastActivityDate: 2020-10-12T19:00:19.603Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm trying to add a couple of fields to the message templates (&quot;CRM_Admin_Form_MessageTemplates&quot;) in a custom extension. I use the &quot;buildForm&quot;, &quot;validateForm&quot; and the &quot;postProcess&quot; hooks. The &quot;buildForm&quot; and the &quot;validateForm&quot; hooks works perfectly but the &quot;postProcess&quot; hook does nothing.
  I'm using civicrm 5.27.4 and drupal 7.72.
  I tried it also on a other installation but same results. I also tried it with a other clean custom extension but that also doesn't work. And the same hook works on other forms.
  Can someone help me?</p>
  
Tags: <hooks><message-templates>
Title: Hook postProcess doesn't work with message templates form
ThreadText: # Hook postProcess doesn't work with message templates form
  
  (Asked by: username_0 on 2020-10-12)
  
  I'm trying to add a couple of fields to the message templates ("CRM\_Admin\_Form\_MessageTemplates") in a custom extension. I use the "buildForm", "validateForm" and the "postProcess" hooks. The "buildForm" and the "validateForm" hooks works perfectly but the "postProcess" hook does nothing.
  I'm using civicrm 5.27.4 and drupal 7.72.
  I tried it also on a other installation but same results. I also tried it with a other clean custom extension but that also doesn't work. And the same hook works on other forms.
  Can someone help me?
  
  **Tags:** hooks, message-templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-10-12. Score: 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 CRM_Admin_Form_MessageTemplates extends CRM_Core_Form {
         }
   
         $messageTemplate = MessageTemplate::save()->setDefaults($params)->setRecords([['id' => $this->_id]])->execute()->first();
  +      $this->postProcessHook();
         CRM_Core_Session::setStatus(ts('The Message Template \'%1\' has been saved.', [1 => $messageTemplate['msg_title']]), ts('Saved'), 'success');
   
         if (isset($this->_submitValues['_qf_MessageTemplates_upload'])) {
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks! will test it!  
  
  ---
  
  