CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How to remove case number from sent emails
Pages: [1]

Author Topic: How to remove case number from sent emails  (Read 1005 times)

klaasvdploeg

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Acquia Drupal 7
  • MySQL version: 4
  • PHP version: 5
How to remove case number from sent emails
February 06, 2013, 11:39:19 am
We are using CiviCase. When a user sends an e-mail from the Case pages, the e-mail contains a case number in de Subject. Looks like this:

From: ...
To: ...
Sent: Thu, 31 Jan 2013 21:29
Subject: [case #b8eff64] Some sample subject

Is it possible to remove the case number from the e-mail? We are not expecting to process reply mails, so we don't need the case number (looks a bit strange).

Thanks for your help.


demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: How to remove case number from sent emails
February 06, 2013, 01:05:02 pm
Edit the civimail template for send copy of activity, e.g. on demo:
http://drupal.demo.civicrm.org/civicrm/admin/messageTemplates/add?action=update&id=1&reset=1

klaasvdploeg

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Acquia Drupal 7
  • MySQL version: 4
  • PHP version: 5
Re: How to remove case number from sent emails
February 08, 2013, 08:06:29 am
Thanks for the pointer, but, we see this case number in custom email messages, not in workflow messages. The user starts the e-mail sending from the 'case roles' section of the case overview page (small link on envelope picture).

Both the email message template and the page showing the email where the user can compose the email do not show any hashId or something alike.
WOuld some screenshots help? THanks.

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: How to remove case number from sent emails
February 09, 2013, 04:42:10 pm
Ah I see.

Use hook_civicrm_alterMailParams.

Or if you're up for submitting a patch to make it configurable you'll find the code in Contact/Form/Task/EmailCommon.php in postProcess().

toxicchili

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.x
Re: How to remove case number from sent emails
March 21, 2013, 04:49:14 am
I know this post is not new, but had a similar thing on one of our sites and created this.  There are probably loads of better ways of doing it, but this seems to work :-)

casemail.module
Code: [Select]
<?php

/*******************
  * Remove Case number from emails.
  *******************/

function casemail_civicrm_alterMailParams(&$params) {
if (strpos($params['subject'],'[case #') !== false) {
$params['subject'] = preg_replace('/\[.*?\]/', '', $params['subject']);
}
}

casemail.info
Code: [Select]
name = casemail
description = removes case number from civicrm cases
core = 7.x
package = hooked
files[] = casemail.module

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How to remove case number from sent emails

This forum was archived on 2017-11-26.