Embedding Multiple Tags in One Parameter

Example

Embedding the current date and customer name in the "subject" parameter of an mgiSendMail tag.

MGI Tags

  • mgiDate
  • mgiFieldContent
  • mgiGet
  • mgiSendMail
  • mgiSet

Steps

  1. Create a form and thank you page.
  2. Open the thank you page in a text editor.
  3. Insert the mgiSet, mgiFieldContent and mgiDate tags.
  4. Embed the mgiGet tag in the beginning mgiSendMail tag.
  5. Save the thank you page.
  6. FTP your home page to the web server running MGI.
  7. Complete and submit the form.


Step 1: Create a form and thank you page.

Following the instructions for processing forms to email, create an information request form and thank you page that contains the mgiSendMail tag.

Step 2: Open the thank you page in a text editor.

Open the thank you page that contains the mgiSendMail tag in a text editing program that allows you to view and modify HTML.

Step 3: Insert the mgiSet, mgiFieldContent and mgiDate tags.

To embed multiple tags in one parameter, set the value of the parameter in a variable. To set the value of a variable, enter a beginning mgiSet tag, name parameter, and ending mgiSet tag. In the body of the mgiSet tag, enter text, the mgiDate tag, and the mgiFieldContent tag and name parameter. In the name parameter of the mgiFieldContent tag, enter the name of the form field that contain's the customer's name. For example,
<mgiSet name="EmailSubject">
<mgiFieldContent name="Name"> Info Request <mgiDate>
</mgiSet>

Step 4: Embed the mgiGet tag in the beginning mgiSendMail tag.

In the mgiSendMail tag, remove the quotation marks and value from the "subject" parameter. Embed an mgiGet tag and name parameter in the "subject" parameter of the mgiSendMail tag. Enter the name of the variable that contains the compiled value of the subject parameter, "EmailSubject", in the name parameter of the mgiGet tag. Enclose the mgiGet tag and its parameter with braces {}.
<mgiSendMail to="info@domain.com" from="webmaster@domain.com"
subject={mgiGet name="EmailSubject"} mailserver="mail.domain.com">
Information Request
*******************

   Name: <mgiFieldContent name="name">
Company: <mgiFieldContent name="company">
Address: <mgiFieldContent name="address">
   City: <mgiFieldContent name="city">
  State: <mgiFieldContent name="state">
    Zip: <mgiFieldContent name="zip">
Country: <mgiFieldContent name="country">
  Phone: <mgiFieldContent name="phone">
  Email: <mgiFieldContent name="email">

Comments:
<mgiFieldContent name="comments">
</mgiSendMail>

Step 5: Save the thank you page.

Save the changes you have made to the thank you page.

Step 6: FTP your home page to the web server running MGI.

Upload the form page and thank you page to the web server with an FTP program.

Step 7: Complete and submit the form.

Access the information request form with a web browser. Complete and submit the form. The email that is sent contains a dynamically created subject such as "Brown Info Request Tue, 16 November, 1999".


[Return to the Embedding MGI Tags Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]