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 CiviContribute (Moderator: Donald Lobo) »
  • How to automatically send email to donors?
Pages: [1]

Author Topic: How to automatically send email to donors?  (Read 549 times)

ashok

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7
  • MySQL version: 5.5.24
  • PHP version: 5.3.10
How to automatically send email to donors?
March 31, 2014, 03:32:02 am
Hi there,

I have written a payment processor and in its response file, I update the donation status of a contribution to COMPLETE inside civicrm_contribution table and redirect donors to thank you page (if payment status returned by my payment processor is complete). While creating a contribution page,CiviContribute has a tab called Receipt to send donation receipts to donors after payment is done and I thought as soon as I updated the status of a donation to COMPLETE in the civicrm_contribution table,  donation  receipt will be sent to users automatically but that does not seem to be the case.

I could use CRM_Utils_Mail::send() function to send e-receipts through emails (an email whose content is generated through code), but there are many contribution pages in my site and e-receipt content is different for all of them. Can't CiviCRM pick up e-receipt content from contribution page's Receipt tab configuration and send emails automatically ?

Anyone has any ideas regarding this?

Thanks in advance,
Negi
« Last Edit: March 31, 2014, 03:49:29 am by ashok »

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How to automatically send email to donors?
March 31, 2014, 11:41:17 pm
Not sure if I follow exactly what you want to achieve, but have you tried if Scheduled Reminders can help you?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

ashok

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7
  • MySQL version: 5.5.24
  • PHP version: 5.3.10
Re: How to automatically send email to donors?
April 01, 2014, 12:22:59 am
Hi Erik,

Thanks for your reply.

Let me re-phrase my query.

When you create a contribution page, there is a configuration option called Receipt which is supposed to automatically send e-receipts to donors on donation completion.  I though as soon as donation status is changed to COMPLETE Civi would automatically send e-receipt to users so in the response file of my payment processor I only do a db query to change donation status to COMPLETE but Civi is not sending e-receipts to donors automatically. However if I edit a donation and check the SEND RECEIPT  option it immediately sends e-receipt. So my question here is why is Civi not sending e-receipts automatically? May be changing donation status to COMPLETE alone is not sufficient for sending e-receipts.

I dont think Scheduled Reminders can help me. My requirement is "to automatically send e-receipts to donors on donation completion".

Thanks,
Negi
« Last Edit: April 01, 2014, 12:26:29 am by ashok »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: How to automatically send email to donors?
April 01, 2014, 01:17:30 am
There are a couple of api that might help you

 civicrm_api3('contribution', 'completetransaction', array('id' => 59);

or

 civicrm_api3('contribution', 'sendconfirmantion', array('id' => 59);

Both utilse the IPN code - ie. the code class that is supposed to handle Instant Payment Notifications from a payment processor. The first confirms a transaction (including sending emails depending on config). The second just sends a confirmation email. The first also confirms related transactions.

There are a handful of tests covering these e.g

https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php#L1215
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How to automatically send email to donors?
April 01, 2014, 02:21:18 am
I would think that you could use Scheduled Reminder based on the activity 'contribution status changed'? Or am I overseeing something (it would not be the first time....)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • How to automatically send email to donors?

This forum was archived on 2017-11-26.