Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8026 Posts in 1851 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationPlugins (Moderators: scott, DanO, Marty)event text not showing in email?
Pages: [1]   Go Down
Print
Author Topic: event text not showing in email?  (Read 314 times)
0 Members and 1 Guest are viewing this topic.
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« on: March 19, 2003, 08:31:00 AM »

I have installed csremind 1.05b , and for the most part it's working fine.  Finally got CRON to execute csr_run.cgi and not PL.  Anyway, my problem is that when I create a scheduled reminder, the CSR Input form does not include "event title" or "description" in the email.  I traced this back as far as the cs_reminders.pl file and looks like this information is not being added there.  I can manually edit the information into cs_remind.pl and it will show up in email.  Any ideas why this info is not added automatically?

Wes

Logged
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« Reply #1 on: March 19, 2003, 09:32:00 AM »

I dug around a bit and found a few omissions and mis-ref'ed variables.

In the file display_after_getEvent.pl

sub csr_show_form
add line : $line =~s/<%csr_desc%>/$csr_desc/isg;

sub csr_set_var
add line : $csr_desc = $csr_q->param('csr_desc');

several occurances of $desc need to be changed to $csr_desc
several occurances of $title need to be changed to $csr_title

Wes

Logged
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« Reply #2 on: March 19, 2003, 09:34:00 AM »

Also in csinput.html,



<-snip->

Sign up for an automatic email reminder for this event.

Should be:



<-snip->



Sign up for an automatic email reminder for this event.

Wes

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: March 19, 2003, 07:31:00 PM »

Sorry but HTML is turned on in this forum so HTML tags won't display. Try wrapping HTML code in a textarea form field.

Dan O.

------------------

Logged
LamarM
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: March 20, 2003, 01:17:00 PM »

For any of you interested, here is a Perl script written by a very smart lady that reads the file events and schedule files and posts an email to an email address or addresses.
an empty file named email.txt is needed in the directory.
This is setup for NT using sendmail, but can easily be modified to work on UNIX.

##Author: Deborah Scott Dominey
##01/30/03
###################################
#This program sends an email listing
#events on the SEA Calendar.
#It must read data from two files:
#"schedule.txt" and "events.txt"
##################################

#NOTE: For the time calculations to
#be exactly correct, this job should
#be executed at 6AM each morning.

################################
#Write over old email message
################################

open(EMAIL_MESSAGE, ">d:/inetpub/wwwroot/Calendar/email.txt")| | die "Couldn't open email.txt";

################
#get current time
################

$t = time(); #This is epoch-system time

################
#convert current time to match different
#parts of "schedule.txt" and "events.txt"
################

$l = localtime;#This is date and time
$month = sprintf "%02d",((localtime)[4]+1);
$day = sprintf "%02d",((localtime)[3]);

################################
#Convert system time into mm/dd/yy format
################################

$datestamp = sprintf "%02d\/%02d\/%02d", ((localtime)[4]+1, (localtime)[3], (localtime)[5]%100);

################################
#Print the header for email message
################################

print EMAIL_MESSAGE "Today's Scheduled Events(as of $l):\n\n";

################################
#Get data from schedule.txt file
################################

open (SCHEDULE, "< d:/inetpub/wwwroot/Calendar/calendarscript/calendars/default/schedule.txt") | | die "Couldn't open schedule.txt";

while ()
{
 @sched_rec = split(/\t/, $_);

################################
#Third and fourth fields contain start and end times
#One day <86400 seconds> must be added to start time because
#the calendar program records the start time
#one day early
################################

$event_start_time = ($sched_rec[2] + 86400);
$event_end_time= $sched_rec[3];


################################
#The following calculation assumes that
#the email will be sent at 6AM each
#morning.
#
#To capture ONLY the events
#that occur from 12:00 AM-11:59PM --
#6 hours are subtracted from "current time"
#and 18 hours are added to "current time."
#  NOTE: Start and end times use seconds
#  because event.txt lists the
#  duration of events in epoch time
################################

$day_start_time = time() - 21600;#current time minus 21600 seconds
$day_end_time = time() + 64800;#current time plus

 
      if  (   (( $sched_rec[6] == $month) && ($sched_rec[7] == $day)) | |       (($event_start_time <= $day_end_time) &&
       ($event_end_time >= $day_start_time)) )
{


################################
#Open events.txt and match
#event_ids from schedule.txt.
#If event_id matches --
#print description in email.
################################

open (EVENT, "    {
    $event = 1;

    while ()
    {
       @event_rec = split(/\t/, $_);
       if  ( $event_rec[0] == $sched_rec[1] )
       {
      print EMAIL_MESSAGE " - $event_rec[2] $event_rec[3]\n";
}
       }
       }
    }

    close(EVENT);

   
}

if ($event != 1){
      print EMAIL_MESSAGE "  - No events are listed on the calendar today.\n";
}

close EMAIL_MESSAGE;

################################
#send the contents of email.txt
#in an email message
################################

$file = "d:/inetpub/wwwroot/SENDMAIL/sendmail.exe";

$var = "d:/inetpub/wwwroot/Calendar/email.txt";

# undefining the input record separator causes the entire file to
# be slurped up into $f in one read. MUST BE DONE FOR NT MACHINES.
$/=undef;
open (FILE, "$var") | | die "can't open $var: $!";
$f=;
close(FILE);

##open pipe to sendmail
@addressee=("email_address_goes_here");


foreach $i (@addressee) {

open(MAIL, "|$file $i") | | die "can't open sendmail";

print MAIL "To: $i\n" ;
print MAIL "From: SEA_Calendar\n" ;
print MAIL "Subject: Calendar for $datestamp\n" ;
print MAIL "$f" ;

foreach(@file){
   print MAIL;
}
}
close ( MAIL ) | | die "Cannot close pipe to sendmail: $!";
close (SCHEDULE);

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: