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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Recurring contributions & membership get immediate email - simple patch
Pages: [1]

Author Topic: Recurring contributions & membership get immediate email - simple patch  (Read 570 times)

flug

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 12
Recurring contributions & membership get immediate email - simple patch
August 30, 2014, 04:59:05 pm
An issue that has come up here and there, is that recurring transaction (for example using Authorize.net) don't get an email confirmation immediately.  Instead, the confirmation comes some time in the middle of the next night when authorize.net processes all recurring transactions in a batch.

This is a double problem because (again as noted by a number of comments in the forum etc) the silent post system is perhaps not the most reliable in the world.  So some individuals make a recurring contribution (the MOST valuable type of donor a nonprofit org can have) and then end up receiving NO email confirmation at all.

Here is a pretty quick & easy mod that allows the contributor/member to receive and instant email confirming their contribution, then another one when the contribution is actually processed.  It puts a variable into the smarty template for membership & contribution receipts so that those response messages can be customized for the first message about the recurring contribution and for the second message then the credit card is actually processed.

I'm putting this in the forums just to get some feedback & your thoughts before entering it in JIRA as a feature request

In CRM/Contribute/BAO/ContributionPage/Utils.php around line 380:

Code: [Select]
    if (!empty($paymentParams['is_recur']) && $form->_contributeMode == 'direct') {

      $form->_values['isInitialRecur'] = TRUE;
      //return TRUE;
    }

In CRM/Member/BAO/Membership.php around line 1507:

Code: [Select]
    if (CRM_Utils_Array::value('is_recur', $form->_params) && $form->_contributeMode == 'direct') {

      $form->_values['isInitialRecur'] = TRUE;
      //return TRUE;
    }

In CRM/Contribute/BAO/ContributionPage.php around line 288:

Code: [Select]
      $tplParams = array(
        'email' => $email,
        'receiptFromEmail' => CRM_Utils_Array::value('receipt_from_email', $values),
        'contactID' => $contactID,
        'displayName' => $displayName,
        'contributionID' => CRM_Utils_Array::value('contribution_id', $values),
        'contributionOtherID' => CRM_Utils_Array::value('contribution_other_id', $values),
        'membershipID' => CRM_Utils_Array::value('membership_id', $values),
        // CRM-5095
        'lineItem' => CRM_Utils_Array::value('lineItem', $values),
        // CRM-5095
        'priceSetID' => CRM_Utils_Array::value('priceSetID', $values),
        'title' => $title,
        'isShare' => CRM_Utils_Array::value('is_share', $values),
        //ADD THIS LINE:
        'isInitialRecur' => CRM_Utils_Array::value('isInitialRecur', $values),
      );

This adds the 'isInitialRecur' variable into the Smarty template whenever the recurring contribution or contribution with membership is initially submitted by the user.

So you can go into your Administer/Communications/Message Templates / System Workflow Messages and add in a section that will be displayed only when that initial recurring transaction is submitted by the user.

Exactly what you want the message to say is, of course, up to you and may vary depending on your requirements.  But below are the messages that I am currently using.

Contributions - Receipt (on-line) AND Memberships - Receipt (on-line) PLAIN TEXT:

Code: [Select]
{if isset($isInitialRecur) && $isInitialRecur}

===========================================================
YOU HAVE SUBMITTED A RECURRING CONTRIBUTION. THANK YOU!

Regular contributions help us build a stable and solid financial base, and
your generous ongoing contribution is helping us do that.

INITIAL ACKNOWLEDGEMENT
This is an initial acknowledgement of your contribution.  Our credit card
processor runs recurring transactions in a batch overnight.  Once the
credit card processor has completed processing your first payment, you will
receive another email message confirming that your credit card payment
was processed.

2ND CONFIRMATION MESSAGE WITHIN 24 HOURS
You should receive this second email message within 24 hours.
===========================================================

{/if}

Contributions - Receipt (on-line) AND Memberships - Receipt (on-line) HTML:
Code: [Select]
  <!-- BEGIN CONTENT -->
{if isset($isInitialRecur) && $isInitialRecur}
 <tr>
   <td style="border:1px solid black;">
<br>
<i><b>YOU HAVE SUBMITTED A RECURRING CONTRIBUTION. THANK YOU!</b><BR><BR>

Regular recurring contributions help us build a stable and solid financial base, and
your generous ongoing contribution is helping us do that.<BR><BR>

<u>This is an initial acknowledgement of your contribution.</u>  Our credit card
processor runs recurring transactions in a batch overnight.  Once the
credit card processor has completed processing your first payment, you will
receive another email message confirming that your credit card payment
was processed.<BR><BR>

<u>You should receive this second email message within 24 hours.</u><BR><BR></i>

   </td>
</tr>
 
{/if}

I'm quite pleased with the results so far.  The additional feature that might be useful, would be to add a checkbox in the contribution page setup to make this initial email message to recurring donors optional.  Depending on your payment processor, this initial message might be very helpful or just confusing.

With authorize.net as a processor, I'm convinced it is helpful.  When people make a donation, they expect and INSTANT automated email confirmation and when they don't receive that, they become nervous and uncertain about whether the payment was actually accepted.
« Last Edit: August 30, 2014, 05:02:57 pm by flug »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Recurring contributions & membership get immediate email - simple patch

This forum was archived on 2017-11-26.