Answers.Body: <p>It's still there. You can look in the civicrm_msg_template table to check. I can't think why it would go missing on upgrade.</p>
  <p>Is this a multilingual install with the message-admin extension installed? It's possible it's looking for the template in another language and there isn't one? I think it would fall back to the default language, but I'm not actually sure how that works.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-02T19:51:53.187Z
Answers.Text: Thank you Demerit, you got me looking in the right direction. This was self-inflicted. I accidentally deleted that template during some clean up.
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-02T00:40:46.617Z
Answers.LastActivityDate: 2024-10-02T00:40:46.617Z
Answers.UserDisplayName: Demerit
Body: <p>CiviRules has long been able to send Activity emails using this code (sites/default/files/civicrm/ext/org.civicoop.civirules/CRM/CivirulesActions/Activity/Add.php line 179 of CiviRules v3.12):</p>
  <blockquote>
  <p>CRM_Case_BAO_Case::sendActivityCopy(NULL, $this-&gt;activityId, [$contact['email'] =&gt; $contact], NULL, NULL);</p>
  </blockquote>
  <p>Since upgrading CiviCRM from 5.73 to 5.75, this fails with the following log record:</p>
  <pre><code>2024-09-14 21:45:48-0400  [error] Rule: '{rule_title}' with id {rule_id} failed for contact {contact_id} because of {reason}
  Array
  (
      [rule_id] =&gt; 1
      [rule_title] =&gt; Marshall followup to an Inbound SMS
      [original_error] =&gt; No message template with workflow name case_activity.
      [contact_id] =&gt; 11156
      [reason] =&gt; Failed to execute action
  )
  </code></pre>
  <p>As far as I can tell the dependency on case_activity is in Core, sites/all/modules/civicrm/CRM/Case/BAO/Case.php line 1406 of CiviCRM v5.77:</p>
  <pre><code>      [$result[$info['contact_id'] ?? NULL], $subject, $message, $html] = CRM_Core_BAO_MessageTemplate::sendTemplate(
          [
            'workflow' =&gt; 'case_activity',
            ...
  </code></pre>
  <p>Does this mean that a message template with &quot;workflow name case_activity&quot; is no longer in the CiviCRM release and I need to create it? If so, how do I go about doing that? I know how to create email and SMS templates, but not how to tie them to a &quot;workflow name&quot; nor how to add Activity fields.</p>
  
Tags: <email><civirules><core><activity>
Title: How to create a message template with a specified workflow name
ThreadText: # How to create a message template with a specified workflow name
  
  (Asked by: username_0 on 2024-10-01)
  
  CiviRules has long been able to send Activity emails using this code (sites/default/files/civicrm/ext/org.civicoop.civirules/CRM/CivirulesActions/Activity/Add.php line 179 of CiviRules v3.12):
  
  > CRM\_Case\_BAO\_Case::sendActivityCopy(NULL, $this->activityId, [$contact['email'] => $contact], NULL, NULL);
  
  Since upgrading CiviCRM from 5.73 to 5.75, this fails with the following log record:
  
  ```
  2024-09-14 21:45:48-0400  [error] Rule: '{rule_title}' with id {rule_id} failed for contact {contact_id} because of {reason}
  Array
  (
      [rule_id] => 1
      [rule_title] => Marshall followup to an Inbound SMS
      [original_error] => No message template with workflow name case_activity.
      [contact_id] => 11156
      [reason] => Failed to execute action
  )
  
  ```
  
  As far as I can tell the dependency on case\_activity is in Core, sites/all/modules/civicrm/CRM/Case/BAO/Case.php line 1406 of CiviCRM v5.77:
  
  ```
        [$result[$info['contact_id'] ?? NULL], $subject, $message, $html] = CRM_Core_BAO_MessageTemplate::sendTemplate(
          [
            'workflow' => 'case_activity',
            ...
  
  ```
  
  Does this mean that a message template with "workflow name case\_activity" is no longer in the CiviCRM release and I need to create it? If so, how do I go about doing that? I know how to create email and SMS templates, but not how to tie them to a "workflow name" nor how to add Activity fields.
  
  **Tags:** email, civirules, core, activity
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-10-02. Score: 2 | Accepted answer
  
  It's still there. You can look in the civicrm\_msg\_template table to check. I can't think why it would go missing on upgrade.
  
  Is this a multilingual install with the message-admin extension installed? It's possible it's looking for the template in another language and there isn't one? I think it would fall back to the default language, but I'm not actually sure how that works.
  
  > **Comments:**
  > **username_0**: Thank you username_1, you got me looking in the right direction. This was self-inflicted. I accidentally deleted that template during some clean up.  
  
  ---
  
  