.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SQLW_MAIL 1" .TH SQLW_MAIL 1 "2008-01-01" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" sqlw_mail \- send mail with data from an SQLite table. .SH "VERSION" .IX Header "VERSION" This describes version \fB0.1001\fR of sqlw_mail. .SH "SYNOPSIS" .IX Header "SYNOPSIS" sqlw_mail \-\-help | \-\-manpage | \-\-version .PP sqlw_mail \-\-database \fIdatabase_file\fR ( \-\-email_col \fIcolumn\fR | \-\-email_address \fIaddress\fR ) [ \-\-limit \fInumber\fR ] [ \-\-mailer \fIstring\fR ] { \-\-not_where \fIcolname\fR=1 } [ \-\-page \fInumber\fR ] [ \-\-row_template \fItemplate\fR ] { \-\-show \fIcolname\fR } { \-\-sort_by \fIcolname\fR } { \-\-sort_reversed \fIcolname\fR=1 } [ \-\-subject \fIstring\fR ] \-\-table \fItable\fR { \-\-where \fIcolname\fR=\fIstring\fR } .SH "DESCRIPTION" .IX Header "DESCRIPTION" This sends emails; one email for each matching row from the given table in the given database. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\-\-email_address" 4 .IX Item "--email_address" An array of email addresses to send the email to. If this is given, this will send an email for each matching row, to each address in the array. Useful for broadcast mailing. .Sp Give either this option or the 'email_col' option. .IP "\-\-email_col" 4 .IX Item "--email_col" The name of the column to take email addresses from. If this is given, then each row is sent to the email address value in that column for that row. Useful for individual notification. .Sp Give either this option or the 'email_address' option. .IP "\-\-database" 4 .IX Item "--database" The name of the database file to use. (required) .IP "\-\-help" 4 .IX Item "--help" Print help message and exit. .IP "\-\-index_template" 4 .IX Item "--index_template" Similar to the report_template, but this is used for the index-pages in multi-page and split reports. It has the same format, but it can be useful to have them as two separate templates as one may wish to change the way the title is treated for indexes versus actual reports. .IP "\-\-limit" 4 .IX Item "--limit" The maximum number of rows to display per page. If this is zero, then all rows are displayed in one page. .IP "\-\-manpage" 4 .IX Item "--manpage" Print the full help documentation (manual page) and exit. .IP "\-\-not_where" 4 .IX Item "--not_where" A hash containing the column names where the selection criteria in where should be negated. .IP "\-\-page" 4 .IX Item "--page" Select which page to generate, if limit is not zero. .IP "\-\-row_template" 4 .IX Item "--row_template" The template for each row. This uses the same format as for headers. If none is given, then a default row_template will be generated, depending on which columns are going to be shown (see show). .Sp The format is as follows: .RS 4 .IP "{$colname}" 4 .IX Item "{$colname}" A variable; will display the value of the column, or nothing if that value is empty. .IP "{?colname stuff [$colname] more stuff}" 4 .IX Item "{?colname stuff [$colname] more stuff}" A conditional. If the value of 'colname' is not empty, this will display \*(L"stuff value-of-column more stuff\*(R"; otherwise it displays nothing. .Sp .Vb 1 \& {?col1 stuff [$col1] thing [$col2]} .Ve .Sp This would use both the values of col1 and col2 if col1 is not empty. .IP "{?colname stuff [$colname] more stuff!!other stuff}" 4 .IX Item "{?colname stuff [$colname] more stuff!!other stuff}" A conditional with \*(L"else\*(R". If the value of 'colname' is not empty, this will display \*(L"stuff value-of-column more stuff\*(R"; otherwise it displays \&\*(L"other stuff\*(R". .Sp This version can likewise use multiple columns in its display parts. .Sp .Vb 1 \& {?col1 stuff [$col1] thing [$col2]!![$col3]} .Ve .RE .RS 4 .RE .IP "\-\-show" 4 .IX Item "--show" An array of columns to select; also the order in which they should be shown when a row_template has not been given. If this option is not used, all columns in the table will be shown. .IP "\-\-sort_by" 4 .IX Item "--sort_by" An array of column names by which the result should be sorted. (Repeat the argument for each new value) .IP "\-\-sort_reversed" 4 .IX Item "--sort_reversed" A hash of column names where the sorting given in sort_by should be reversed. .IP "\-\-subject" 4 .IX Item "--subject" A template (as for row_template) of the Subject: line of the emails. .IP "\-\-table" 4 .IX Item "--table" The table to report on. (required) .IP "\-\-verbose" 4 .IX Item "--verbose" Print informational messages. .IP "\-\-version" 4 .IX Item "--version" Print version information and exit. .IP "\-\-where" 4 .IX Item "--where" A hash containing selection criteria. The keys are the column names and the values are strings suitable for using in a \s-1LIKE\s0 condition; that is, '%' is a multi-character wildcard, and '_' is a single-character wildcard. All the conditions will be ANDed together. .Sp Yes, this is limited and doesn't use the full power of \s-1SQL\s0, but it's useful enough for most purposes. .SH "REQUIRES" .IX Header "REQUIRES" .Vb 4 \& Getopt::Long \& Pod::Usage \& Getopt::ArgvFile \& SQLite::Work; .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1) Getopt::Long Getopt::ArgvFile Pod::Usage .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to the author. .SH "AUTHOR" .IX Header "AUTHOR" .Vb 3 \& Kathryn Andersen (RUBYKAT) \& perlkat AT katspace dot com \& http://www.katspace.com .Ve .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" Copyright (c) 2005 by Kathryn Andersen .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.