I want to make soem changes to this plugin so that it can work for me as a mail confirmation of adding and editing events. Basically any user(username is email address already) adds or edits an event, an email confirmation will be sent to this user only, with the event time, title included in the email body.
Could you give me some suggestion on how to make it?
Thanks for the nice plugin.
------------------
Here's the way you'd have to do it.
1) change after_add_event to after_schedule_event (filename and subroutine name).
2) You then have access to $User->{username} for the email address, and you can use these to get the schedule and details of the event (they return a reference to a hash containing all the information in $EVENT in the templates:
$db = new DBFile($schedule_db);$schedule = $db->getRecord( {'event_id'=>$event_id} );$db = new DBFile($events_db);$details = $db->getRecord( {'id'=>$event_id} );
3) Then you can send the email to the person with a link back to the calendar_admin.pl like this: http://www.yoursite.com/cgi-bin/calendar_admin.pl?command=confirm&id=event_id
4) Notice I used the command confirm. This means you need to write another plugin file (command_confirm) which does the same thing as the approve function in calendar_admin.pl, only doesn't require APPROVE permissions and has no visual interface except for the email links.
Notice that if someone can get past the password protection of the script, this setup really won't do much good. All I can think of to increase security (which I guess is the reason you are confirming events in the first place) would be to send a randomly generated password in the link in the email, and save that password encrypted in an extra field in the events database. Then only allow the command_confirm function to keep running if the encrypted version of the password sent back to you through the link is equal to the one in the database.
Hope that got your creative juices flowing. Let me know if you need more details.
------------------David Whittaker http://www.uabcm.com/ http://www.csworkbench.com/
Sorry my previous post was a little confusing. Actually what I meant was not to increase security, probably I should not have used the word 'confirmation', the email should just work as a reminder to the user that they've added or edited an event.
I want to use this calendar tool for a reservation system we maintains. Users log on to it and pick a resource(pick a calendar) we have and make a reservation(all the events are auto approved). Every time a user makes a reservation or changes a reservation, I want to have an email sent to this user automatically as a record for him and maybe a reminder to him of his reservation.
This is pretty similar to this plugin, therefore I post it here just to get some of your suggestions. The more details the better..;-)
Thanks a lot
One thing to note, if you don't mind waiting until I have a few less projects, EmailNotify2 will have that functionality and more. You can pick which events (as in adding, editing, or approving, not calendar events) will send an email. Then each user can decide whether or not they recieve an email for a specific event (or the administrators can decide for them). With the combination of a modified AutoRegister plugin (I'll modify it to set email preferences for the new user as well) and EmailNotify2, you can have a system where a user signs themselves up, then recieves email every time they add an event, edit that event, and optionally, a few hours (or days) before the event occurs. I will work on that plugin every time I get a chance, but no guarantees on when it will be available. Tentatively, though, I'm saying the end of the month if my schedule doesn't get any worse.
Thanks for providing us these great functions.
Just wanted to check on your progress with EmailNotify2... One of the things I'm looking for is to have the guts of the event listed in the admin notify of an event. For now, I want to know when an event has been added (to make sure "Jack's Birthday" kinds of things don't appear). If all that info were in the e-mail, I wouldn't have to pop out there, log in, view the calendar, find the new entry, etc, etc....
Thanks for some REALLY great scripts!
-Joe
/usr/sbin/sendmail
and
sendmail
I can see the plugin in my admin screen (of course, or else I couldn't change the mail path) so it's installed correctly. But no mail ever shows up.
There is another script that I run on my site, I'm sure you all have heard of it, the ever popular formmail by Matt Wright. This is a c&p from that script:
code:# $mailprog defines the location of your sendmail program on your unix system.#$mailprog = '/usr/sbin/sendmail';
# $mailprog defines the location of your sendmail program on your unix system.#$mailprog = '/usr/sbin/sendmail';
$mailprog = '/usr/sbin/sendmail';
and my formmail works perfectly, and you can see that the path is the same as I've tried above. I don't get it.
Anyone have any ideas?
GREATLY APPRECIATED
Can anyone who understands what might be going on here please offer me some insights? TubaDave, do you have any ideas what might be going wrong?
I see that others are using the plug-in with success...
Greatly appreciated!!!Claudia
Jason S
------------------Stephanie MeemkenWebmaster, Minnesota Jayceeshttp://www.mnjaycees.org/
Still not working. Jason, I reinstalled making sure to send in ASCII mode and permissions are 777. The plug in shows up just fine in my Plug-In screen. I can change the parameters there, just no mail shows up. I've tested it with a user that is strictly a quest, and a user with 'approve own events' permission.
I'm wondering if its action could be getting interference with one of my other plugins. I don't know Perl and I don't know how David Whittaker's plugins interact with each other. This is how my plugins folder looks:
DeleteOld (dir)EmailNotify (dir)OneClick (dir)redirect (dir)after_schedule_event.plcommand_list.txtpermissions_list.txtplugin_files.txtplugins.txt
Since there are several things that happen 'after_add_event' by all these different scripts (I've peeked at the code, trying to discover something), can one be making the other not run? I'm just trying to understand what's happening here, someone with the expertise answer me this: If the Redirect takes control 'after_add_event' could it be that the sendmail never gets executed, its 'after_add_event' (which send the mail to me) never happens? It gets skipped over so to speak.
Is anyone else who is running EmailNotify effectively also running the other plugins as I am?
TubaDave? Can you shed any light on this?
Thank you!Claudia
$properties->{'author_id'} = $User->{'username'}; $properties->{'author_name'} = $User->{'name'}; $properties->{'time_added'} = time; if ($User->hasPermission("","APPROVE") | | $User->hasPermission($calendar,"APPROVE_OWN_EVENTS")) { $properties->{'approved'} = 1; } else { &addUserMessage(&getMessage("EVENT_SAVED_PENDING_APPROVAL")); &handleCustomFunction("after_add_event"); }
The line you add is the last on (&handleCustom Function...).
I have gotten it to work with oneclick & redirector enabled. The no overlap was giving me errors. i will continue to look at it and post here if I get it to work.
[This message has been edited by Jason S (edited August 15, 2002).]
Jacob