Functions | |
string | TD_form () |
string | SP_form () |
string | TD (type val) |
string | Row (type args) |
string | Intro () |
string | Header () |
string | Space () |
string | SubjectRow () |
string | ContactRow () |
string | SpaceRow () |
string | SubSectionRow (optional val=Details) |
string | TimeRow () |
string | StartTimeRow () |
string | Line () |
string | Head () |
string | Rows () |
string | Var (type var) |
string | List2Html (type list) |
join the list together using the "<BR>" as delimiter | |
string | Classify (type host) |
classify the host and set the TYPE and COLOR | |
string | B (type args) |
join args together and return the bold HTML string | |
string | Fg (type color, type args) |
join args together and return the color foreground HTML string | |
string | Bg (type color, type args) |
join args together and return the color background HTML string | |
string | MakeBodyToHTML (type template, type args) |
create a new mime object TOK of type text/html | |
Variables | |
type | HEADER |
the HEADER of the html body message, this is the most visible information | |
type | COLOR |
set the color of the high information parts in the email to something like red, blue, brown or black | |
type | TYPE |
set the type of the email like PRODUCTION, DEVELOPMENT, TEST or UNKNOWN | |
type | SUBJECT |
additional information added to HEADER with lower priority | |
type | ROWS |
a list of key/value pairs to create the detail section of the HTML eMail | |
type | FONT = Arial |
the default font to use | |
type | CONTACT_MAIL = $SYSGROUP |
the email address of the user/group used in the mail-to link of the HTML eMail | |
type | CONTACT_NAME = $SYSGROUPNAME |
the name of the user/group used in the mail-to link of the HTML eMail | |
array | BACKGROUND_ALARM_COLORS = { 0 "#FFFFFF" 1 "#FFFFFF" 2 "#FFDBB8" 3 "#FFB8B8" 4 "#FFB8DB" 5 "#FF7A7A" } |
alarm colors used to signal states with different colors |
The HTML eMail package from file lib/libEmail.tcl
is available with:
package require email ?1.0?
example:
info.htm
package require email set email::HEADER "HTML test email" set email::SUBJECT "used to test the local setup" email::Classify $HOST set email::ROWS { token value ... } ::email::MakeBodyToHTML info.htm
The HTML feature is very powerful, to discover all possibilities use the plugin plugins/self/ping.tcl
together with the template template/ping.htm
as example.
variable | string NAME = DEFAULT | set NAME DEFAULT |
variable | array NAME = DEFAULT | array set NAME DEFAULT |
procedure | string NAME ( type ARG1, ... ) | proc NAME {ARG1 ...} |
procedure | string NAME ( optional ARG1=DEF1, ... ) | proc NAME {{ARG1 DEF1} ...} |
string email::TD_form | ( | ) |
string email::SP_form | ( | ) |
string email::TD | ( | type | val | ) |
string email::Row | ( | type | args | ) |
string email::Intro | ( | ) |
string email::Header | ( | ) |
string email::Space | ( | ) |
string email::SubjectRow | ( | ) |
string email::ContactRow | ( | ) |
string email::SpaceRow | ( | ) |
string email::SubSectionRow | ( | optional | val = Details |
) |
string email::TimeRow | ( | ) |
string email::StartTimeRow | ( | ) |
string email::Line | ( | ) |
string email::Head | ( | ) |
string email::Rows | ( | ) |
string email::Var | ( | type | var | ) |
string email::List2Html | ( | type | list | ) |
join the list together using the "<BR>" as delimiter
string email::Classify | ( | type | host | ) |
string email::B | ( | type | args | ) |
join args together and return the bold HTML string
args | the list of arguments be bold |
string email::Fg | ( | type | color, | |
type | args | |||
) |
join args together and return the color foreground HTML string
color | the foreground color | |
args | the list of arguments be colorized |
string email::Bg | ( | type | color, | |
type | args | |||
) |
join args together and return the color background HTML string
color | the background color | |
args | the list of arguments be colorized |
string email::MakeBodyToHTML | ( | type | template, | |
type | args | |||
) |
create a new mime object TOK of type text/html
template | the template to use relative to the template sub-directory of the BID server installation | |
args | additional arguments, currently only supported -keep |
text/html
using the template and the variables defined. The template have to be a relative file-name in the template sub-directory of the BID server installation. -keep
is available the new mime object is created using the Initialize command and the old mime object is put on the stack and is available after the Finalize command is executed. If the argument -keep
is not available the old mime object is deleted. The header of the new mime is cleared and the From mime header token is set from the previous mime object TOK.
type email::HEADER |
the HEADER of the html body message, this is the most visible information
type email::COLOR |
set the color of the high information parts in the email to something like red, blue, brown or black
type email::TYPE |
set the type of the email like PRODUCTION, DEVELOPMENT, TEST or UNKNOWN
type email::SUBJECT |
additional information added to HEADER with lower priority
type email::ROWS |
a list of key/value pairs to create the detail section of the HTML eMail
type email::FONT = Arial |
the default font to use
type email::CONTACT_MAIL = $SYSGROUP |
the email address of the user/group used in the mail-to
link of the HTML eMail
type email::CONTACT_NAME = $SYSGROUPNAME |
the name of the user/group used in the mail-to
link of the HTML eMail
array email::BACKGROUND_ALARM_COLORS = { 0 "#FFFFFF" 1 "#FFFFFF" 2 "#FFDBB8" 3 "#FFB8B8" 4 "#FFB8DB" 5 "#FF7A7A" } |
alarm colors used to signal states with different colors
The colors differ from level 0=green up to level 5=red