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) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Contribution receipts as pdf attachments instead of html email?
Pages: [1]

Author Topic: Contribution receipts as pdf attachments instead of html email?  (Read 1677 times)

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
Contribution receipts as pdf attachments instead of html email?
October 26, 2010, 11:01:50 am
Maybe I'm missing it but I'm wondering if contribution receipts that normally are sent as html emails after someone makes a contribution can be set to be pdf attachments instead? I see a site admin can manually print a pdf letter, but I'm looking for it to automatically go instead of the html email.

The main reason is that images don't really work in html emails, so an alternative suggestion might work.

Thanks.

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: Contribution receipts as pdf attachments instead of html email?
October 26, 2010, 04:20:37 pm

hey dave:

you can definitely do this via a the mail alter hook.

might want to send them the regular email and also include the PDF as an attachment to the email, so users can download and print the receipt (the PDF can be well formatted with images etc). the main issue would be, how would you generate this PDF? not sure if any good open source libraries exist (pdflib.com is commercial but would work well here)

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

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: Contribution receipts as pdf attachments instead of html email?
October 26, 2010, 05:04:44 pm
Ok, so I guess I'm not missing a setting, but now I have another question: Does whatever you're using for the Print PDF Letter action require a paid license? It looks like dompdf (under packages) and is LGPL, no? Or maybe you're saying there's no way to get images in there?

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: Contribution receipts as pdf attachments instead of html email?
October 26, 2010, 05:22:19 pm

dompdf is free and has a compatible open source license (not sure which one) with CiviCRM

it basically converts html to pdf and i'm not sure if/how well it handles images. u'll need to experiment with it. from my limited experience, it does html quite well, has trouble with css

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

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: Contribution receipts as pdf attachments instead of html email?
October 27, 2010, 11:55:11 am
Tried some hacks. Seems to do OK with images.

I can do this with the hook but it seems like a generally useful thing. To include this in core just for contribution receipts looks like about the same amount of work as making it a little more general. Maybe on a per message template basis. except not sure where to store that in db without adding a column. I thought about the setting for contact-level communication preferences, but it doesn't make sense to have a pdf attachment for many of the emails.

The sendTemplate function accepts a params array, so maybe for now it could go there when called from contribution receipts and figure out where to put it later? Except then there's no way to turn it off (civicrm.settings.php?)

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: Contribution receipts as pdf attachments instead of html email?
October 27, 2010, 07:35:55 pm

how about including the pdf of the receipt in both contribution and event registration emails

seems like having this as a parameter of the message template is a good on/off setting. maybe for a future release

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

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: Contribution receipts as pdf attachments instead of html email?
November 02, 2010, 05:53:06 am
This will be in 3.3
http://issues.civicrm.org/jira/browse/CRM-7002

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Contribution receipts as pdf attachments instead of html email?

This forum was archived on 2017-11-26.