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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Send Contribution Email Receipt on Add?
Pages: [1]

Author Topic: Send Contribution Email Receipt on Add?  (Read 1703 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Send Contribution Email Receipt on Add?
December 07, 2010, 05:02:20 pm
Is there a way we can trigger an email receipt to be sent automatically when we create a new contribution via the v2 API?  What field/param do we need to set to make that happen?

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: Send Contribution Email Receipt on Add?
December 07, 2010, 05:29:11 pm

not right now, but when/if we have rules integrated with civicrm, triggering a rule to send an email is potentially much easier. Check:

http://civicrm.org/blogs/lobo/civimail-workflow-functionality-rules-integration-coming-civicrm-v331

for more details and please do consider contributing when we introduce the make-it-happen sometime this week :)

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

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Send Contribution Email Receipt on Add?
December 08, 2010, 06:39:29 am
I really like the rules integration idea, we wanted to expand on that for other things as well (building workflows for our mission team events, with triggers at certain key due dates).  I'll keep an eye out for the make-it-happen.

What about using a hook?  If I set up a hook that fires on contribution creation, filter it for the contribution type/source I want, is there a way to trigger the email send through the hook?  I'm assuming the hook would be triggered even when a contribution is made through the API.  I guess I just need a pointer to the code where the email is sent when that checkbox is checked on the admin form.  I'm hoping I can call that same method somehow.

I would love any pointers if it's possible.  Thanks much.

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: Send Contribution Email Receipt on Add?
December 08, 2010, 06:50:01 am

CRM/Contribute/BAO/ContributionPage.php, function sendMail

You should check: CRM/Core/Payment/BaseIPN.php to see how the function is invoked (some amount of setup required)

and CRM/Contribute/Form/Task/PDF.php

for some ideas on how to reuse the current code :)

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

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: Send Contribution Email Receipt on Add?
December 09, 2010, 01:24:20 pm

The 3.4 / 4.0 make it happen projects have now been selected. You can read all about it here:

http://civicrm.org/blogs/eileen/whats-happening-next-make-it-happen

and hopefully help make the rules integration happen:

http://civicrm.org/civicrm/contribute/transact&reset=1&id=12

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Send Contribution Email Receipt on Add?

This forum was archived on 2017-11-26.