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) »
  • Missing email address in receipt message to Organization (on behalf of)
Pages: [1]

Author Topic: Missing email address in receipt message to Organization (on behalf of)  (Read 761 times)

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Missing email address in receipt message to Organization (on behalf of)
December 07, 2009, 01:53:07 am
In 2.2.9 on at least two sites CiviCRM is failing to include the e-mail address for the organization contact in the thankyou/receipt email that is sent, when the contribution page includes the "make contribution on behalf of an organization" option is enabled.

The email headers look like this in the error state:

Code: [Select]
From: "CiviCRM Org" <info@civicrmorg.org>
To: "Signup Organization" <>
Cc: info@civicrmorg.org,"Testonly Testperson" <signupindividual@gmail.com>

In this example CiviCRM Org is the org of the website/CiviCRM install in question, and Signup Organization is the organization on the behalf of which Testonly Testperson is signing up.

For some reason  sendMail() in /CRM/Contribute/BAO/ContributionPage.php has a blank/empty value for the $email variable in this case. I fixed it in my code by adding the following to sendMail(), at line 160:

Code: [Select]
            //HACK - problem getting on-behalf-of org email, so if $email is empty, we should get it from $contactID (org cid)                                                                                                       
            if ($email == '') {
              $inputParams = array('contact_id' => $contactID);
              $returnProperties = array('email' => 1);
              require_once 'CRM/Contact/BAO/Query.php';
              $newParams =& CRM_Contact_BAO_Query::convertFormValues( $inputParams );
              list( $org_contacts, $options ) = CRM_Contact_BAO_Query::apiQuery( $newParams,
                                                                                 $returnProperties,
                                                                                 null,
                                                                                 null, //sort
                                                                                 0, //offset
                                                                                 1, //rowcount
                                                                                 false ); //smartgroupcache
              $email = $org_contacts[$contactID]['email'];
            }
            // END HACK               

Don't know if I'm using that internal "get contact's email" query code correctly, as I typically just use the API functions.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Missing email address in receipt message to Organization (on behalf of)
December 07, 2009, 06:07:55 am
I faintly remember about this issue and I think it is fixed in 3.0.x. But not sure ...

This might be related: http://issues.civicrm.org/jira/browse/CRM-5042

HTh
Kurund
« Last Edit: December 07, 2009, 06:09:38 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Missing email address in receipt message to Organization (on behalf of)

This forum was archived on 2017-11-26.