9 |
|
|
10 |
sender.pl - command line notify sender utility |
sender.pl - command line notify sender utility |
11 |
|
|
12 |
|
=head1 SYNOPSYS |
13 |
|
|
14 |
|
sender.pl --add=mylist members.txt |
15 |
|
sender.pl --list |
16 |
|
sender.pl --queue=mylist message.txt |
17 |
|
sender.pl --send=mylist |
18 |
|
|
19 |
|
=head2 All options |
20 |
|
|
21 |
|
=over 20 |
22 |
|
|
23 |
|
=item --debug |
24 |
|
|
25 |
|
Turn on debugging output from C<Class::DBI> |
26 |
|
|
27 |
=cut |
=cut |
28 |
|
|
29 |
my ($list_opt,$debug) = (0,0); |
my ($list_opt,$debug) = (0,0); |
55 |
my $messages = $loader->find_class('messages'); |
my $messages = $loader->find_class('messages'); |
56 |
my $message_list = $loader->find_class('message_list'); |
my $message_list = $loader->find_class('message_list'); |
57 |
|
|
58 |
|
=item --list |
59 |
|
|
60 |
|
List all available lists and users on them |
61 |
|
|
62 |
|
=cut |
63 |
|
|
64 |
if ($list_opt) { |
if ($list_opt) { |
65 |
foreach my $list ($lists->retrieve_all) { |
foreach my $list ($lists->retrieve_all) { |
66 |
print $list->name,"\n"; |
print $list->name,"\n"; |
69 |
print "\t",$user->full_name," <", $user->email, ">\n"; |
print "\t",$user->full_name," <", $user->email, ">\n"; |
70 |
} |
} |
71 |
} |
} |
72 |
|
|
73 |
|
=item --add=list_name |
74 |
|
|
75 |
|
Add users to list. Users are stored in file (which can be supplied as |
76 |
|
argument) or read from C<STDIN>. List should be in following format: |
77 |
|
|
78 |
|
email@example.com Optional full name of person |
79 |
|
dpavlin@rot13.org Dobrica Pavlinusic |
80 |
|
|
81 |
|
=cut |
82 |
|
|
83 |
} elsif ($add_opt) { |
} elsif ($add_opt) { |
84 |
#my $noticer = $loader->find_class('Noticer') || die "can't find my class!"; |
#my $noticer = $loader->find_class('Noticer') || die "can't find my class!"; |
85 |
my $list = $lists->find_or_create({ |
my $list = $lists->find_or_create({ |
111 |
|
|
112 |
print "list ",$list->name," has $added users\n"; |
print "list ",$list->name," has $added users\n"; |
113 |
|
|
114 |
|
=item --queue=list_name |
115 |
|
|
116 |
|
Queue message for later delivery. Message can be read from file (specified as |
117 |
|
argument) or read from C<STDIN>. |
118 |
|
|
119 |
|
=cut |
120 |
|
|
121 |
} elsif ($queue_opt) { |
} elsif ($queue_opt) { |
122 |
my $this_list = $lists->search( |
my $this_list = $lists->search( |
123 |
name => $queue_opt, |
name => $queue_opt, |
144 |
print "added message ",$this_message->id, " to list ",$this_list->name,"\n"; |
print "added message ",$this_message->id, " to list ",$this_list->name,"\n"; |
145 |
|
|
146 |
} else { |
} else { |
147 |
die $0.' |
die "see perldoc $0 for help"; |
|
--list show all lists and users |
|
|
--add=name_of_list < users.txt add users (email@example.com full name) |
|
|
--queue=name_of_list < message queue message for sending to list |
|
|
--debug |
|
|
'; |
|
148 |
} |
} |
149 |
|
|
150 |
|
=back |
151 |
|
|
152 |
|
=head1 AUTHOR |
153 |
|
|
154 |
|
Dobrica Pavlinusic <dpavlin@rot13.org> |
155 |
|
|
156 |
|
=cut |
157 |
|
|