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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Switch activity state after scheduled reminder
Pages: [1]

Author Topic: Switch activity state after scheduled reminder  (Read 427 times)

Tony Horrocks

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 7
    • Fabriko Limited
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7
Switch activity state after scheduled reminder
September 24, 2012, 01:31:51 am
I'm using Scheduled Reminders as a way to automate workflow. For example, I setup an activity which is "Send my first letter" and use Scheduled Reminders to send it. It would be nice if Scheduled Reminders could be repurposed to change the activity status from scheduled to completed once these tasks are done, so it extends from a reminder tool to an automated workflow tool.

I see that several hooks are called when the scheduled reminders are processed and that these can be used to changed the activity status via a custom module.

Does anyone know the starting point of what these hooks are?
Tony Horrocks
Author of the CiviCRM CookBook https://www.packtpub.com/web-development/civicrm-cookbook

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Switch activity state after scheduled reminder
September 24, 2012, 05:31:04 am
When a reminder is sent - an entry is created in civicrm_action_log table with success / failure details.
This could be a good indicator of, if a reminder was processed.

When an action log is created following hooks are called:
hook_civicrm_pre and hook_civicrm_post with $objectName as 'ActionLog'.

To look at other hooks that are called during processing of reminders,
CRM_Core_BAO_ActionSchedule::sendMailings() is the function you could look at.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Tony Horrocks

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 7
    • Fabriko Limited
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7
Re: Switch activity state after scheduled reminder
September 24, 2012, 05:49:12 am
Cheers!
Tony Horrocks
Author of the CiviCRM CookBook https://www.packtpub.com/web-development/civicrm-cookbook

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Switch activity state after scheduled reminder

This forum was archived on 2017-11-26.