-
Notifications
You must be signed in to change notification settings - Fork 0
/
MailReminderPlugin.txt
257 lines (217 loc) · 14.1 KB
/
MailReminderPlugin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
%META:TOPICINFO{author="guest" date="1099489158" format="1.0" version="1.3"}%
---++!! Mail Reminder Plugin (version 1.000)
The <nop>MailReminderPlugin handles the tag *%<nop>MAILREMINDER_PLUGIN%* that inserts a monthly calendar in the page and It allows you to send reminders before those events. It is the extension of Calendar Plugin. I have modified the existing code of Calendar Plugin so as to enable it to send reminders befores the date of event.
%TOC%
---++ Usage example
<table border=1 width="80%">
<tr><th>You type:</th><th>You get:</th><th>If correctly installed:</th></tr>
<tr><td>
Following are the configurations for user name and email address. just copy into your page ;
+ Name = YOUR NAME
+ email = yourid@domain.com
+ reminder = 3
( Reminder tells the no. of days before the event it should send email )
Specify list of events as following using bullets:
* 2 Feb - Andrea's birthday
* 7 Mar - Nicoletta's birthday
* 29 May 1996 - Maria Teresa is born!
* 29 Sep 1998 - Davide is born!
To delete the event
- 29 Sep 1998 - Davide is born!
%<nop>MAILREMINDER_PLUGIN{month="2" year="2002" bgcolor="cyan"}%
%<nop>MAILREMINDER_PLUGIN{month="3" year="2002" showweekdayheaders="1"}%
</td><td align=center>
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top" align="left">
<td align="left" valign="top" bgcolor="black"><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td colspan=7 bgcolor="pink"><center><font size=+2>February 2002</font></center></td></tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">1 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">2 <br> Andrea's birthday </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">3 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">4 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">5 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">6 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">7 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">8 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">9 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">10 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">11 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">12 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">13 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">14 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">15 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">16 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">17 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">18 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">19 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">20 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">21 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">22 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">23 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">24 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">25 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">26 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">27 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black">28 </td>
<td width="14" valign="center" align="center" bgcolor="cyan" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black"> </td>
</tr>
</table>
</td>
</tr>
</table>
<p />
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top" align="left">
<td align="left" valign="top" bgcolor="black"><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td colspan=7 bgcolor="pink"><center><font size=+2>March 2002</font></center></td></tr>
<tr>
<th bgcolor="white">Sunday</th>
<th bgcolor="white">Monday</th>
<th bgcolor="white">Tuesday</th>
<th bgcolor="white">Wednesday</th>
<th bgcolor="white">Thursday</th>
<th bgcolor="white">Friday</th>
<th bgcolor="white">Saturday</th>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">1 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">2 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">3 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">4 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">5 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">6 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">7 <br> Nicoletta's birthday </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">8 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">9 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">10 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">11 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">12 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">13 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">14 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">15 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">16 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">17 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">18 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">19 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">20 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">21 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">22 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">23 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">24 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">25 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">26 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">27 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">28 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black">29 </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">30 </td>
</tr>
<TR>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black">31 </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="white" bordercolor="black"> </td>
<td width="14" valign="center" align="center" bgcolor="lightgrey" bordercolor="black"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td><td align=center>
%MAILREMINDER_PLUGIN{month="2" year="2002" bgcolor="cyan"}%
%MAILREMINDER_PLUGIN{month="3" year="2002" showweekdayheaders="1"}%
</td></tr>
</table>
---++ Syntax
| *You type* | *you get* |
| %<nop>MAILREMINDER_PLUGIN% | a monthly calendar for the current month/year, with events taken from the current topic |
| %<nop>MAILREMINDER_PLUGIN{<attributes>}% | is the full syntax |
---+++ User settings Event settings and Setting to delete event from database - Syntax
User set the Various information parameters as follows:
| *Command type* | *Syntax* | *Example* |
| *Specify Name* :| == + Name = YOUR NAME== | + Name=Naval |
| *Specify email* :| == + email= Yourid@yourdomain== | + email = naval@it.iitb.ac.in |
| *Reminder before days* :| == + reminder = number of days before the event== | + reminder=3 |
| *Specify event*: | == * dd MMM yyyy - description== | 09 Dec 2002 - Expo |
| *Delete event*: | == - dd MMM yyyy - description== | 09 Dec 2002 - Influence 02 |
---++ Default settings
* One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic:
* Set SHORTDESCRIPTION = This plugin shows a monthly calendar with highlighted events
* How the cell content is formatted
<verbatim>
* Set FORMAT = $old <br /> $description
</verbatim>
* __Note:__ You can add settings of any of the recognized attributes (in upper case like SHOWWEEKDAYHEADERS)
---++ Plugin Installation Instructions
__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
* Download the ZIP file from the Plugin web (see below)
* The Plugin uses the ==HTML::CalendarMonthSimple== and ==Date::Calc== CPAN packages (see http://www.cpan.org)
* Install ==Date::Calc==
* Install ==HTML::CalendarMonthSimple==
* Change line 197 of <nop>CalendarMonthSimple.pm as follows to avoid an annoying log message:<br />
=if ($self->year == $todayyear && $self->month == $todaymonth <font color="red">&& defined $thisday</font> && $thisday == $todaydate)=
* Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
| *File:* | *Description:* |
| ==data/TWiki/%TOPIC%.txt== | Plugin topic |
| ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
| ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
| ==lib/TWiki/Plugins/%TOPIC%/cron.pl== | Plugin Perl module |
| ==lib/TWiki/Plugins/%TOPIC%/config_file== | Plugin configruraion file |
| ==lib/TWiki/Plugins/%TOPIC%/calender_config_file== | Plugin configruraion file |
| ==pub/TWiki/%TOPIC%/exclam.gif== | Image file |
* (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
*Create Table to store events in my database*
Structure of table is as follows:
| *Field* | Type | Null | Key |
|name | varchar(30) | YES | |
|e_date | date | | PRI |
|r_date | date | YES | |
|email_id | varchar(100) | | PRI |
|event | varchar(200) | | PRI |
*Mysql query to create table is* :
Create table caltab(name varchar(30), e_date date not Null ,r_date date, email_id varchar(100) not Null, event varchar(200) not Null, primary key(e_date, event, email_id));
*Edit cront tab as follows to make entry for cronjob* :
In shell prompt execute :- crontab -e [Enter]
* Vi editor will be opened make the following crontab entry and save the file:-
* 01 00 * * * /[path of your lib/TWiki/Plugin directory]/MailReminderPlugin/cron.pl
*Make changes in configuration files*
* In /[Path of Plugins Directory]/MailReminderPlugin/calender_config_file :- Should be configured with various database related settings like database host ,database user , database password , database name.
* In /[Path of Plugins Directory]/MailReminderPlugin/config_file :- Should be configured with various database settings and mail related settings like Smtp server name , email of sender etx.
---++ Plugin Info
| Plugin Author: | TWiki:Main/AshishNaval |
| Plugin Version: | V1.000 (03 Nov 2004) |
| Change History: | <!-- versions below in reverse order --> |
| CPAN Dependencies: | CPAN:HTML::CalendarMonthSimple >= v1.23, CPAN:Date::Calc |
| Other Dependencies: | none |
| Perl Version: | 5.000 and up |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
__Related Topics:__ %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences, [[%SYSTEMWEB%.Plugins][Plugins]]
-- Main.AshishNaval - 03 Nov 2004