Answers.Body: <p>When sending email via email activity only contact tokens are supported. If you have <a href="https://civicrm.org/extensions/civicase-tokens" rel="nofollow noreferrer">Civicase token extension</a> installed and enabled than you can pass <code>caseid=34</code> (where 34 is case id) in activity email url</p>
  
  <pre><code>eg http://example.org/civicrm/activity/email/add?atype=3&amp;action=add&amp;reset=1&amp;context=standalone&amp;caseid=34
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:36:35.097Z
Answers.Text: Yes, the token extension adds about 4 fields, but not the whole case columns, nor any extended case data.
Answers.UserDisplayName: Simon Walden
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T15:38:04.897Z
Answers.LastActivityDate: 2020-06-04T20:35:00.800Z
Answers.LastEditDate: 2020-06-04T20:35:00.800Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>They work if you use the email icon in the roles section on manage case to initiate the email. They don't work if you use Contacts -> New Email from the general menu since it won't know what case it is.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:35:18.490Z
Answers.Text: I'm talking about emails sent from within the case - where it does not work - not even coded.
Answers.UserDisplayName: Simon Walden
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T15:43:10.807Z
Answers.LastActivityDate: 2020-06-04T15:43:10.807Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>OK, I'm really not sure why this has not been done.  It was a handful of lines changed in 2 files to make this work.</p>
  
  <p>It was so easy I'm concerned I'm missing something about why it was not setup in the first place.</p>
  
  <p>the main change is in CRM/activity/BAO/activity.php  which needs an extra argument to pass the case ID and then a few extra lines to for replaceCaseTokens().   Case_ID needs passing from messagetemplate.</p>
  
  <p>If anyone needs this they can DM me for the details, its in test now.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:59:56.630Z
Answers.Text: What version are you on? See also https://github.com/civicrm/civicrm-core/pull/16105
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-05T07:55:08.730Z
Answers.Text: Excellent.   I'll pick this up.
Answers.UserDisplayName: Simon Walden
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-04T20:40:39.020Z
Answers.LastActivityDate: 2020-06-04T20:40:39.020Z
Answers.UserDisplayName: Simon Walden
Body: <p>I have templates that use a range of tokens from the contact and the case, including standard case tokens and custom fields.  i.e. </p>
  
  <p>{contact.display_name}   {case.id}   {case.subject}   {case.custom_154}</p>
  
  <p>The case tokens are not processed when sending an email (via email activity)</p>
  
  <p>They are processed on print/merge document.  (via print/merge document activity)</p>
  
  <p>Is this by design?</p>
  
Tags: <email><civicase>
Title: civiCase emails don't use case tokens?? Print/merge does? What am I doing wrong?
ThreadText: # civiCase emails don't use case tokens?? Print/merge does? What am I doing wrong?
  
  (Asked by: username_0 on 2020-06-04)
  
  I have templates that use a range of tokens from the contact and the case, including standard case tokens and custom fields. i.e.
  
  {contact.display\_name}   {case.id}   {case.subject}   {case.custom\_154}
  
  The case tokens are not processed when sending an email (via email activity)
  
  They are processed on print/merge document. (via print/merge document activity)
  
  Is this by design?
  
  **Tags:** email, civicase
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2020-06-04. Score: 2
  
  When sending email via email activity only contact tokens are supported. If you have Civicase token extension installed and enabled than you can pass caseid=34 (where 34 is case id) in activity email url
  eg http://example.org/civicrm/activity/email/add?atype=3&action=add&reset=1&context=standalone&caseid=34
  
  > **Comments:**
  > **username_0**: Yes, the token extension adds about 4 fields, but not the whole case columns, nor any extended case data.  
  
  ---
  
  ### Answer by username_2 on 2020-06-04. Score: 1
  
  They work if you use the email icon in the roles section on manage case to initiate the email. They don't work if you use Contacts -> New Email from the general menu since it won't know what case it is.
  
  > **Comments:**
  > **username_0**: I'm talking about emails sent from within the case - where it does not work - not even coded.  
  
  ---
  
  ### Answer by username_0 on 2020-06-04. Score: 0
  
  OK, I'm really not sure why this has not been done. It was a handful of lines changed in 2 files to make this work.
  
  It was so easy I'm concerned I'm missing something about why it was not setup in the first place.
  
  the main change is in CRM/activity/BAO/activity.php which needs an extra argument to pass the case ID and then a few extra lines to for replaceCaseTokens(). Case\_ID needs passing from messagetemplate.
  
  If anyone needs this they can DM me for the details, its in test now.
  
  > **Comments:**
  > **username_2**: What version are you on? See also https://github.com/civicrm/civicrm-core/pull/16105  
  > **username_0**: Excellent.   I'll pick this up.  
  
  ---
  
  