You need to be logged in to view a user's profile.
  1. keb1965
  2. JEvents 1.4
  3. Friday, 11 December 2009
I was in need of an automation client for my installation, to automatically email members to remind them of upcoming events. For the most part everything is working. I wrote a PHP script that reads the DB and extracts the event information and then outputs that to a mail client. That PHP script is called using a cron job once a day.

Initially I hard coded all of the email addresses in the script (not very user friendly) and only sent email reminders if an event was going to happen "tomorrow". I reasoned that occasionally it may be desirable to notify the users at an earlier or later date i.e. 1 week prior to the event to allow ample time to make arrangments to attend .. or the morning of the event to ensure the event is remembered for that day or perhaps a reminder will be needed multiple times.

So, I went about adding an E-mail Notification tab to JEvents ... I figured at minimum, to have a single reminder date, I needed 3 fields ...
[list]
email_notify - tinyint(1)
notify_date -datetime
email_recipient longtext
[/list:u]

I created the additional fields in the admin.events.html.php file and added the requisite fields to mosEvents in events.class.php ...

Since everything is already installed, I simply added the DB fields manually ...

When I edit an event, I can read the values stored in the DB easily enough and save the values back, with the exception of my checkbox for email_notify.

The checkbox code is:


function checkNotify(){
var check = 0;
if (document.adminForm.notify_date.checked==true){
var check = 1;
}
return check;
}

<span><input type="checkbox" id="email_notify" name="email_notify" value="0" onclick="checkNotify();"
<?php if ($row->email_notify == 1) echo "checked"; ?>/></span>



The event code is:

$email_notify = mosGetParam( $_POST, 'email_notify','' );
if( $email_notify == 1){
$row->email_notify = 1;
} else {
$row->email_notify = 0;
}


I am not the smartest cookie when dealing with forms transactions, although it seems to be pretty straightforward ... I know it is something relatively simple ... I'd appreciate a nudge in the right direction.

Thanks


There are no replies made for this post yet.
Be one of the first to reply to this post!

Members Area

Show your support

Unlike many Joomla calendars we do not charge to download JEvents - please show your support for this project by becoming a member of the JEvents Club Club members get access to early releases, exclusive member support forums, and Silver and Gold members can use many exciting JEvents addons

Your membership will ensure that JEvents continues to be the best events calendar for Joomla.