yml:message
Description
Creates a form that opens a message dialog for the user.
With the dialog, the user can then send a message to a
Yahoo! connection (friend) to tell the connection about the application.
In yml:message, form controls with the following names are allowed:
to, subject, body, image, link_href, link_label, submit.
To see how these controls work, see the Examples section.
Attributes
| Name | Type | Required/Optional | Description |
|---|---|---|---|
| view | string | optional | Name of application view, for example, YahooFullView. |
| params | string | optional | Path to a program, relative to the application containing the yml:message tag. The DOM node specified by the insert or replace attribute is inserted into or replaced by the output of the program specified by the params attribute.
|
| replace | string | optional | The ID of a DOM node to replace with the output of the params specified.
|
| insert | string | optional | The ID of a DOM node whose contents will be replaced with the output of the params specified.
|
Examples
The yml:message and div tags in the following listing are in the code
of the Canvas view (YahooFullView).
When the yml:message tag is executed, a form in a message dialog
appears to the user.
The message dialog is populated with the form controls
named subject, to, body, and submit.
The value of the to control is the GUID of a Yahoo! user who
is a connection (friend) of the user sending the message.
(You can specify multiple GUIDs, separated by commas.)
In the message dialog, the "To" field contains the display name
of the connection.
When the user clicks the submit button (labelled "Send message now"),
an email is sent to the Yahoo! user specified by the GUID of
the to form control.
The output of myprog.php is inserted into the DOM node
of the div with the ID sect1, replacing the contents of the div.
In Yahoo! Mail, the message appears as an email in the recepient's inbox.
The text in the email's subject and body correspond to the values specified
by the form controls in the yml:message tag.
The email contains three other elements: an "Add" button,
an image, and a link.
By clicking the "Add" button, the recipient can install
the application run by the sending user
(that is the application containing the yml:message tag.)
The image in the email is specified by the
image form control of the yml:message tag.
The link in the email is labelled "Click me",
as specified by the link_label form control.
The destination of the link is click_from_email.php,
as indicated by link_href.

