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) »
  • Sending receipt emails as text/html
Pages: [1]

Author Topic: Sending receipt emails as text/html  (Read 836 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Sending receipt emails as text/html
June 01, 2009, 06:00:25 am
I just finished upgrading a site from v2.0 to v2.2 and am reimplementing a number of modifications. One mod was that I had modified all the auto-generated receipt emails to be html instead of plain text. All I had to do to trigger that in the previous version was modify CRM/Utils/Mail.php, around line 140 to change the content-type to text/html.

I've reimplemented that in v2.2, but my emails are still being sent as text/plain. Has the method for sending receipt emails changed? l've searched through the codebase but can't find any other place that appears to be controlling the content-type for those emails.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Sending receipt emails as text/html
June 01, 2009, 10:06:04 am

most of that code has not changed, BUT we fixed a few bugs that might have affected your code :)

might be easiest to debug in IRC. We added one new function called: setMimeParams and also use the header returned by reference from the function getHeaders

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Sending receipt emails as text/html
June 01, 2009, 10:51:19 am
Ok, so there's an additional check mechanism in v2.2 that switches back to text/plain. To override this I added:

Code: [Select]
$headers['Content-Type'] = 'text/html; charset=utf-8';
around line 168 (after $headers is set). That ensured the correct content-type was set before emailing.

Now I just need to finish updating all the receipt template files...
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Sending receipt emails as text/html

This forum was archived on 2017-11-26.