MailTo.pm


NAME

Communiware::DE::MailTo - Dynamic element MailTo


SYNOPSIS

   <:MailTo template userlist [format [expr]]:>


DESCRIPTION

Dynamic element MailTo allows designer to specify in the template than mail should be sent to specified list of registered Communiware users upon submission of form.

It should appear only in form context. It may appear in Posting form, in which case it could send just created item, or on usual page.


ARGUMENTS

template
Template to be userd to generate message. Use Header dynamic element in this template to provide subject and simular informaton

This template is processed just as usual page template with AUTHOR_ID set to AUTHOR_ID of user, who have submitted form.

userlist
Valid Communiware filter specification for filter which should return list of addressees.

Hint if you have list of checkboxes with name NAME in your form, (%NAME) is valid Communiware filter specification, which would return list of values of checked boxes.

If userlist is not specified and template has non-empty OLD_URL attribute, it is assumed that target address is stored in OLD_URL attribute of template.

format
may be ``html'' or ``plain''. Defaults to ``html''. If plain is specified, then message is converted to plain text before sending.

expr
All the rest of arguments is interpreted as logical expression. If it has at least one element, mailing would be only performed if it evaluates to true.

DEFINING MESSAGE HEADERS

Template designer can do almost anything with generated mail message.

Arbitrary heades can be set using Header dynamic element from template which is used to format message.

Following headers are generated unless template provides other values:

From
E-Mail address of user how submitted a form containing MailTo dynamic element

Subject
Title of item to be sent

To
Full list of recipients. Note: value of this header serves only information purposes and doesn't affect actual mail delivery (except some very broken e-mail setup). So, you can safely set it to any value you like, even it doesn't look like valid E-Mail address.

Content-Type
Set to text/html. You can redefine it if your template generates some other DTD. Dynamic element MailTo doesn't support authomatic html to plaintext conversion as subscription system does.

16 октябрь 2007 13:44