Email
Transmits data to a valid email account.
Usage
email (data, from-email-addr, to-email-addr, mailhost, subject, prologue, template, epilogue : )
Details
Data contained in data is formatted as specified by template
and send to to-email-address with subect subject via
mailhost mailhost, using from-email-address as the
reply-to entry. Both the from- and to- e-mail addresses must be
complete (i.e., user@host.domain.organization), and the mailhost
must be the fully specified name of an Internet-reachable SMTP
host. Templates consist of static data plus slots for dynamic
data contained in data to be filled in, these slots being
identified by $(name of relation attribute)$.
Notes
- It is possible to specify carraige returns by using the \n characters. When including carraige returns in literals within the plan text, however, make sure to escape the backslash (i.e., use \\n).
- Similarly, the dollar symbol can be used literally via \$
Known Bugs
Example
Using the input:
RELATION books: title char, author char, pub_date date, pages number
Title1|Author1|09-01-1991|34
Title2|Author2|12-23-1954|479
Title3|Author2|05-09-2002|733
Title4|Author3|01-01-1968|32
Title5|Author2|07-03-2001|1152
RELATION pro: dummy char
Greetings,\n\nThe current list of titles includes:\n
RELATION tmpl: dummy char
-- $title$ by $author$
RELATION epi: dummy char
Sincerely,\n your agent
when executing the plan:
PLAN test
{
INPUT: stream books
OUTPUT:
BODY
{
email (books, "person1@example.com", "person2@example.com", "mailhost.example.com", "Important update on book inventory", pro, tmpl, epi : )
}
}
will generate the following email message:
From: person1@example.com
To: person2@example.com
Subject: Important update on book inventory
Greetings,
The current list of titles includes:
-- Title3 by Author2
-- Title2 by Author2
-- Title5 by Author2
-- Title4 by Author3
-- Title1 by Author1
Sincerely,
your agent