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) »
  • Pledge reminder emails
Pages: [1]

Author Topic: Pledge reminder emails  (Read 1074 times)

dschafer

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 3
    • Backoffice Thinking
  • CiviCRM version: 3.2.3 - 4.4.4
  • CMS version: Drupal 6.x, 7.x, Wordpress
  • MySQL version: 5.1.x - 5.5.x
  • PHP version: 5.2.x - 5.4.x
Pledge reminder emails
September 27, 2010, 09:11:48 pm
Hi ,
Can't seem to find the secret sauce to make this work.

I 've uncommented the line in UpdatePledgeRecord.php to enable reminder sending.

However everytime I run the script I only get updates on overdue pledges

The query
Code: [Select]
        SELECT    pledge.contact_id    as contact_id,
        pledge.id                      as pledge_id,
        pledge.amount                  as amount,
        payment.scheduled_date         as scheduled_date,
        pledge.create_date             as create_date,
        payment.id                     as payment_id,
        pledge.contribution_page_id    as contribution_page_id,
        payment.reminder_count         as reminder_count,
        pledge.max_reminders           as max_reminders,
        payment.reminder_date          as reminder_date,
        pledge.initial_reminder_day    as initial_reminder_day,
        pledge.additional_reminder_day as additional_reminder_day,
        pledge.status_id               as pledge_status,
        payment.status_id              as payment_status,
        pledge.is_test                 as is_test,
        SUM(payment.scheduled_amount)  as amount_due,
        ( SELECT sum(civicrm_pledge_payment.scheduled_amount)
        FROM civicrm_pledge_payment
        WHERE civicrm_pledge_payment.status_id = 1
        AND  civicrm_pledge_payment.pledge_id = pledge.id
        ) as amount_paid
        FROM      civicrm_pledge pledge, civicrm_pledge_payment payment
        WHERE     pledge.id = payment.pledge_id
        AND     payment.status_id IN ( {$statusIds} ) AND pledge.status_id IN ( {$statusIds} )
        GROUP By  payment.id

in UpdatePledgeRecord.php returns all reminder dates as null.

Can anyone point me in the right direction?

Thanks

Keith

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Re: Pledge reminder emails
December 17, 2010, 08:36:28 am
I am not sure exactly how the system is supposed to work, but rummaging around in the code I found in UpdatePledgeRecord.php

On line 57, where the function is defined, I found:
Code: [Select]
    public function updatePledgeStatus( $sendReminders = false )
I.e, it calls for a true parameter to send reminders.

However at the bottom of the file where the function is actually called, it shows
Code: [Select]
$obj = new CRM_UpdatePledgeRecord( );
echo "Updating<br />";
$obj->updatePledgeStatus( );
echo "<br />Pledge records updated. (Done)";
i.e., passing no parameter. Since the parameter defaults to false, you have to call the function with True to make is send reminders.

So I added true to the call
Code: [Select]
$obj->updatePledgeStatus( )and it now sends out reminders.

This must be a bug because I can't see how it could possibly ever send out reminders with the settings as they are in the code (3.2.1)

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Pledge reminder emails
December 17, 2010, 11:39:14 pm
Expected behavior is by default don't send reminders.
In case you'd like to send reminders, you just need to uncomment one line, no need to change function call.

do check comment in UpdatePledgeRecord.php line around 60, 61
Code: [Select]
        // *** Uncomment the next line if you want automated reminders to be sent
        // $sendReminders = true;

just uncomment this line
Code: [Select]
// $sendReminders = true; as
Code: [Select]
$sendReminders = true;and system should send the reminders.

kiran
You Are Designed To Choose... Defined By Choice.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Pledge reminder emails

This forum was archived on 2017-11-26.