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) »
  • Reminders
Pages: [1] 2

Author Topic: Reminders  (Read 4585 times)

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Reminders
October 04, 2007, 07:18:13 am
Hi,

When I for instance schedule a phone call or meeting I can set the Date and Time.
Is there a way when this time/date is near CiviCRM can send a reminder via email?

I am currently using CiviCRM 1.7 with drupal 5


-Carlo

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Reminders
October 04, 2007, 09:18:27 am
I'll let one of the core folks provide the real answer, but here are the outlines:
(1) CiviCRM does not currently provide this functionality.
(2) Most timed things are driven by a cron job, so basically a program would check every set time period (e.g. hour) and see what is coming up, and generate an email.
(3) This would be a great contribution to either code yourself, find someone to code for you, or hire someone to code.
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: Reminders
October 09, 2007, 05:51:46 am
I was going to work on this by using a bash shell script or php script in a cron job to do the query and send the email?
Thought this would be the easiest way?

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: Reminders
October 09, 2007, 01:30:38 pm

writing a php script to do the above and putting it in a cron job is probably the easiest way to do this. Please share the code on the forum if you do so

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

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: Reminders
October 10, 2007, 06:11:46 am
for sure.
I will submit it once I get there.
Still working on some other features for the office and civicrm.
Thanks

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Reminders
October 10, 2007, 02:19:03 pm
After discussing with donald on IRC, donald told me that event notification will not be implemented in core but he will implement some hooks which will allow us to create them ourselves. For now i post my idea of implementing this as a drupal function inside civicrm.module.

Code: [Select]
function civicrm_cron() {
$key = "0";
$from = variable_get('site_mail', ini_get('sendmail_from'));
$result = db_query('SELECT civicrm_uf_match.email, civicrm_activity.subject, civicrm_activity.details
FROM civicrm_uf_match, civicrm_activity
WHERE civicrm_activity.source_contact_id = civicrm_uf_match.contact_id
AND status="Scheduled"
AND DATE(scheduled_date_time) = DATE_ADD(CURDATE(), INTERVAL -1 DAY)');
while ($row = db_fetch_array($result)) {
$subject = "CRM Reminder: ".$row['subject'];
$body = "Event details: \n\n".$row['details'];
drupal_mail($key, $row['email'], $subject, $body, $from);
$key++;
}
}

Currently this function only checks the civicrm_activity table (so it will only work for now for activity: event) . When drupal cron runs it will automatically run this function and send an email to the person who created the the activity. It will run only on an event which is set to "Scheduled" and will send an email one day before the event occurs" Currently there is no way to know if an event has been send or not so if you run cron mutiple times per day it will also send multiple emails per day.
If you want to use this function please remember to set cron to run just after midnight. It will then send an email to the person who created the event one day before. I will update the query tomorrow to also include the other activity's.

P.S. I'm not sure if civicrm_uf_match.email is the correct field to check for the user who created the event but it works in my situation.

-Carlo

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: Reminders
October 11, 2007, 06:19:12 am
I will give this a try this or next week.
Maybe another table to just not the id of the activity to reference as being sent or not?
Great work by the way, I did not even think of using drupal for this but it makes a ton of sense.

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Reminders
October 19, 2007, 07:43:05 am
Hi,

I finally got some time to spend on this so I created a Drupal module (sorry Joomla users).
Could somebody here please check it out and see if its working. If you see any code issues please let me know and I will update it.
If you have any feature request regarding this module please let me know and i will see if i can find the time to implement it.

You can find it here: http://issues.civicrm.org/jira/browse/CRM-2344

-Carlo

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: Reminders
October 19, 2007, 08:31:01 am
not able to untar it ?
alfred@alfred-laptop:~/test$ tar xzvf civicrm_notifications.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

I will test it though when I get a working one.
Feel free to email me as well
alfred@nationalpriorities.org

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Reminders
October 19, 2007, 08:40:21 am
Hmmm... I created an issue just to be able to attach this module because the forum doesn't allow me to attach archives.
I tried it again and it still fails so I've had to upload it somewhere else. Get it here:

http://www.clict.nl/civicrm_notifications.tar.gz

-Carlo
« Last Edit: October 19, 2007, 08:45:53 am by clandmeter »

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Reminders
October 19, 2007, 10:47:21 am
Awesome contribution clandmeter !! Thank you.

You might consider getting cvs rights to Drupal and contributing your module to the repository where people can contribute patches, extend it, etc.
http://drupal.org/cvs-account

It will join about 22 CiviCRM-related modules already in contributions:
http://drupal.org/search/node/type%3Aproject_project+civicrm

Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Reminders
October 25, 2007, 05:02:07 am
Little update for this module:

  • Changed the SQL query which should be correct now.
  • Added variables to be used in the email template.
  • Added some comments to the function.
  • Cleaned up some code.


http://www.clict.nl/civicrm_notifications.tar.gz

Regards,

Carlo

BioBen

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
Re: Reminders
November 19, 2007, 07:15:21 am
Carlo -
This is exactly what I was looking for, but I'm having some troubles configuring the notifications.
Is this compatible with 1.9?  I'm running 1.9 and the latest Drupal version.  I enabled your module in the Drupal admin page and have granted the correct permissions.
Should there be an area in the CiviCRM admin area to configure the reminder/notification?
Any documentation would help if you could point me in the right direction.

Let me know

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: Reminders
November 19, 2007, 07:39:35 am
Hi BioBen,

You are right, you can't find it anywhere in CiviCRM. civicrm_notifications is a drupal module and not a CiviCRM module.
If you go to your admin page inside drupal you should be able to find it. I haven't checked yet if it is properly working in 1.9, but if there were no database changes then it should work.

You should find the settings here: admin/settings/civicrm_notifications

Enjoy,

Carlo

BioBen

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
Re: Reminders
November 19, 2007, 11:08:32 am
Ah, nice.  I placed your file in the CiviCRM folder.  I'll take it out of there and enable it again.

- Thanks for the quick response.  I'll let you know if it's good to go with 1.9.

_________________
Sweet.  I see it now.  It appears to be good to go.
« Last Edit: November 19, 2007, 11:15:20 am by BioBen »

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Reminders

This forum was archived on 2017-11-26.