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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Schedule Reminders for Activities
Pages: [1] 2

Author Topic: Schedule Reminders for Activities  (Read 4850 times)

circlebails

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
  • CiviCRM version: 4.1.X 4.2.X
  • CMS version: Drupal-6.X / Drupal-7.X
  • MySQL version: 5.1
  • PHP version: 5.2.16/17, 5.3
Schedule Reminders for Activities
June 22, 2011, 06:16:27 am
Hi

I'm assuming (due to the lack of any documentation i can find) the these (e.g. civicrm/admin/scheduleReminders?action=update&id=1&reset=1) are reliant on a cron script being run?

The question is, if so which?

Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Schedule Reminders for Activities
June 22, 2011, 09:26:55 am
If your listed CiviCRM version is correct, then you need to upgrade for this. See here:

http://civicrm.org/blogs/lobo/recap-consulting-project-automated-reminder-emails-and-lot-more

 
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

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: Schedule Reminders for Activities
June 22, 2011, 11:28:39 am

the cronjob is: bin/action.cronjob.php

would be great if you can help document that feature. Its also fairly new, so you will/might hit a few bugs :)

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

circlebails

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
  • CiviCRM version: 4.1.X 4.2.X
  • CMS version: Drupal-6.X / Drupal-7.X
  • MySQL version: 5.1
  • PHP version: 5.2.16/17, 5.3
Re: Schedule Reminders for Activities
June 23, 2011, 03:25:14 am
I'll try to update the docs when I manage to get the cronjob running correctly. However when I run:

/usr/bin/wget -O - -q -t 1 --post-data='name=someuser&pass=somepass&key=somekey' 'http://foo.org.uk/sites/all/modules/civicrm/bin/action.cronjob.php'

It returns html to the console, when I open this in a browser I see:

Sorry. A non-recoverable error has occurred.
DB Error: no such table
Error Details
Additional Details:
Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] =>
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT e.source_contact_id as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as action_schedule_id
FROM civicrm_activity e

LEFT JOIN civicrm_action_log reminder ON reminder.contact_id = e.source_contact_id AND
reminder.entity_id    = e.id AND
reminder.entity_table = 'civicrm_activity' AND
reminder.action_schedule_id = 1
WHERE e.activity_type_id IN (1) AND e.status_id IN (1) AND reminder.id IS NULL AND 20110623111720 >= DATE_SUB(e.activity_date_time, INTERVAL 1 hour) [nativecode=1146 ** Table 'hash_civicrm.civicrm_action_log' doesn't exist]
    [type] => DB_Error
    [user_info] =>
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT e.source_contact_id as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as action_schedule_id
FROM civicrm_activity e

LEFT JOIN civicrm_action_log reminder ON reminder.contact_id = e.source_contact_id AND
reminder.entity_id    = e.id AND
reminder.entity_table = 'civicrm_activity' AND
reminder.action_schedule_id = 1
WHERE e.activity_type_id IN (1) AND e.status_id IN (1) AND reminder.id IS NULL AND 20110623111720 >= DATE_SUB(e.activity_date_time, INTERVAL 1 hour) [nativecode=1146 ** Table 'foo_civicrm.civicrm_action_log' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT e.source_contact_id as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as action_schedule_id
FROM civicrm_activity e

LEFT JOIN civicrm_action_log reminder ON reminder.contact_id = e.source_contact_id AND
reminder.entity_id    = e.id AND
reminder.entity_table = 'civicrm_activity' AND
reminder.action_schedule_id = 1
WHERE e.activity_type_id IN (1) AND e.status_id IN (1) AND reminder.id IS NULL AND 20110623111720 >= DATE_SUB(e.activity_date_time, INTERVAL 1 hour) [nativecode=1146 ** Table 'foo_civicrm.civicrm_action_log' doesn't exist]"]
)

The rable foo_civicrm.civicrm_action _log indeed doesn't exist and I was under the impression that this table only existed if the new logging feature was enabled?

Thanks

Bails

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Schedule Reminders for Activities
June 23, 2011, 04:53:54 am
It looks like this table is missing in your install. Have you run all the civicrm/upgrade without error ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

circlebails

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
  • CiviCRM version: 4.1.X 4.2.X
  • CMS version: Drupal-6.X / Drupal-7.X
  • MySQL version: 5.1
  • PHP version: 5.2.16/17, 5.3
Re: Schedule Reminders for Activities
June 23, 2011, 05:01:43 am
Hi Xavier

The site in question is running CiviCRM 3.4.3

Yes we ran the civicrm/upgrade?reset=1 without any errors.

I can see:


CREATE TABLE civicrm_action_log (


     id int unsigned NOT NULL AUTO_INCREMENT  ,
     contact_id int unsigned    COMMENT 'FK to Contact ID',
     entity_id int unsigned NOT NULL   COMMENT 'FK to id of the entity that the action was performed on. Pseudo - FK.',
     entity_table varchar(255)    COMMENT 'name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant',
     action_schedule_id int unsigned NOT NULL   COMMENT 'FK to the action schedule that this action originated from.',
     action_date_time datetime    COMMENT 'date time that the action was performed on.',
     is_error tinyint   DEFAULT 0 COMMENT 'Was there any error sending the reminder?',
     message text    COMMENT 'Description / text in case there was an error encountered.',
     repetition_number int unsigned NOT NULL   COMMENT 'Keeps track of the sequence number of this repetition.'
,
    PRIMARY KEY ( id )
 
 
,     
     CONSTRAINT FK_civicrm_action_log_contact_id FOREIGN KEY (contact_id) REFERENCES civicrm_contact(id) ON DELETE CASCADE,     
     CONSTRAINT FK_civicrm_action_log_action_schedule_id FOREIGN KEY (action_schedule_id) REFERENCES civicrm_action_schedule(id) ON DELETE CASCADE 
)  ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci  ;

In civicrm/sql/civicrm.mysql

Should I create the this table by hand?

circlebails

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
  • CiviCRM version: 4.1.X 4.2.X
  • CMS version: Drupal-6.X / Drupal-7.X
  • MySQL version: 5.1
  • PHP version: 5.2.16/17, 5.3
Re: Schedule Reminders for Activities
June 23, 2011, 07:49:18 am
Just an update:

I've just updated another CiviCRM from 3.4.1 to 3.4.4 and the table civicrm_action_log does not exist.

Can someone let me know where and in which in the upgrade script this table is meant to be created?

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: Schedule Reminders for Activities
June 23, 2011, 07:52:51 am

ARGHHHHH

bug in upgrade script. this is not included. Can you please file an issue, will be fixed for the next release

in the meantime, u can create the table manually from a clean 3.4.4 mysql

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

circlebails

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
  • CiviCRM version: 4.1.X 4.2.X
  • CMS version: Drupal-6.X / Drupal-7.X
  • MySQL version: 5.1
  • PHP version: 5.2.16/17, 5.3
Re: Schedule Reminders for Activities
June 23, 2011, 10:53:12 am
Issue filed.

http://issues.civicrm.org/jira/browse/CRM-8348

I can confirm that creating the table by hand does enable the action.cronjob.php script to be run and schedule reminders be sent as expected.

circlebails

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
  • CiviCRM version: 4.1.X 4.2.X
  • CMS version: Drupal-6.X / Drupal-7.X
  • MySQL version: 5.1
  • PHP version: 5.2.16/17, 5.3
Re: Schedule Reminders for Activities
June 24, 2011, 06:44:59 am
Hi Just tried setting another reminder on another 3.4.4 site only to receive the following when cron runs.


    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT  as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as action_schedule_id
FROM civicrm_activity e

LEFT JOIN civicrm_action_log reminder ON reminder.contact_id =  AND
reminder.entity_id    = e.id AND
reminder.entity_table = 'civicrm_activity' AND
reminder.action_schedule_id = 1
WHERE e.activity_type_id IN (2) AND e.status_id IN (1) AND reminder.id IS NULL AND 20110624143029 >= DATE_SUB(e.activity_date_time, INTERVAL 1 hour) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as actio' at line 2]
    [type] => DB_Error
    [user_info] =>
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT  as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as action_schedule_id
FROM civicrm_activity e

LEFT JOIN civicrm_action_log reminder ON reminder.contact_id =  AND
reminder.entity_id    = e.id AND
reminder.entity_table = 'civicrm_activity' AND
reminder.action_schedule_id = 1
WHERE e.activity_type_id IN (2) AND e.status_id IN (1) AND reminder.id IS NULL AND 20110624143029 >= DATE_SUB(e.activity_date_time, INTERVAL 1 hour) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as actio' at line 2]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
SELECT  as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as action_schedule_id
FROM civicrm_activity e

LEFT JOIN civicrm_action_log reminder ON reminder.contact_id =  AND
reminder.entity_id    = e.id AND
reminder.entity_table = 'civicrm_activity' AND
reminder.action_schedule_id = 1
WHERE e.activity_type_id IN (2) AND e.status_id IN (1) AND reminder.id IS NULL AND 20110624143029 >= DATE_SUB(e.activity_date_time, INTERVAL 1 hour) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as contact_id, e.id as entity_id, 'civicrm_activity' as entity_table, 1 as actio' at line 2]"]
)

Reminder set was:

activity > phone call > scheduled > when 1hr before activity date time > recipients = activity assignees

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: Schedule Reminders for Activities
June 24, 2011, 06:28:30 pm

hey bails:

can you please file an issue for this and link to this forum post

thanx

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

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Schedule Reminders for Activities
August 23, 2011, 08:50:44 am
Is this issue is resolved or still in working condition? please let me know becuase i got the same issue too.
thanks

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Schedule Reminders for Activities
September 30, 2011, 06:53:19 am
Hi, i have got the same issue. i am using civicrm 4.0.5 version and seems like my sechdule reminder are not working. have anyone solved this one or still in progress? although i tried to sent the civi mail but it was doing untill i have run "/index.php?q=civicrm/mailing/queue&reset=1" one it sends the emails but schedule reminders are still not set yet. do i have to setup the cronjobs for schedule reminders first.

confused please help...

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Schedule Reminders for Activities
October 02, 2011, 09:04:02 am
> do i have to setup the cronjobs for schedule reminders first.

Yes.

Lobo wrote:

> the cronjob is: bin/action.cronjob.php

So you need a cron job for that. The syntax ist the same as the CiviMail cron, just the "civimail.cronjob.php" changes to action.cronjob.php. See here:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviMail+Installation#CiviMailInstallation-SettingUptheCronJob

for the basic idea.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Schedule Reminders for Activities
October 11, 2011, 08:04:44 am
hi,

i have tried the 'using the shell' method but it didnt work. for mailing it is saying 'Delivery has not yet begun for this mailing'.

Code: [Select]
# This must be set to the directory where civicrm is installed.
CIVI_ROOT=/var/www/vid/sites/all/modules/civicrm


# Comment: I believe these two lines are unnecessary.
# USER=www-data
# MAILTO="you@example.org"


# Location of the PHP Command Line Interface binary.
# nice -19 forces to run at a lower priority than the web server
PHP=nice -n19 /usr/bin/php


# line to be modified according to the informations below
# like this: PARAMS= -s<default or domain> -u<user> -p<password>
PARAMS= -sdefault -uadmin -ppasswor


# cronjob send
# m h dom mon dow command
5 * * * *  cd $CIVI_ROOT; $PHP bin/civimail.cronjob.php $PARAMS
15 * * * * cd $CIVI_ROOT; $PHP bin/EmailProcessor.php   $PARAMS

I dont know where i am doing wrong?

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Schedule Reminders for Activities

This forum was archived on 2017-11-26.