Send your emails in 3 clicks, with emailR.com, nothing is easier.

Working with Optional regions

Choose a profile Enter a campaign name and select a sender profile which you set a single time only for each of your clients and/or projects.
Load your distribution list
Select the source containing the email addresses (database, Excel file, CRM). This data source is defined once only for each profile. EmailR takes care of the rest!
Send your email
You enter the subject of the email, then either select one of the templates and use the latest-generation publisher provided or load your own HTML composition.

Working with Optional regions

An optional region is a region in a newsletter that users can set to show or to hide depending of a specific value in the distribution list. Use an optional region when you want to set conditions for displaying content in a newsletter.

When you insert an optional region, you can define conditional statements (If... statements) for newsletter regions. Use simple true/false operations, or define more complex conditional statements and expressions. You can later modify the optional region if necessary. Based on the conditions you define, the newsletter will be adapted for each recipient depending of the associated value in the database.

Set optional regions and parameters

To do so, you can either use the optional regions functionality in Adobe© DreamWeaver© or insert corresponding code manually in the HTML source.

Using Adobe© Dreamweaver©:

  1. In the Document window, select the element you want to set as an optional region.
  2. Do one of the following:
    • Select Insert > Template Objects > Optional Region.
    • Right-click (Windows) or Control-click (Macintosh) the selected content, then select Templates > New Optional Region.
    • In the Common category of the Insert bar, click the Templates button, then select Optional Region from the pop-up menu.
  3. Click the Advanced tab, select the Enter Expression radio button to set values for the optional region, and then click OK.

Entering the code in the HTML source:

  1. Open the optional region with the following comment code: <!-- TemplateBeginIf cond="" -->
  2. Set the condition value: field name, operator and value. I.e. cond="fieldName=value"
  3. Close the optional region with the following code: <!-- TemplateEndIf -->

Important remarks:

  • Use only mathematic operators like '<<', '<', '<=', '=', '==', '>=', '>', '>>', '!=' and '<>'
  • Avoid using nested optional regions
  • emailR may behave differently when evaluating conditions with strings or numeric values. I.e. "11>2" returns "True" because it contains numeric values only, but "11a>2a" will return "False".
  • To test a condition against several values:
    • use the Javascript '||' (meaning OR) Logical operator. If any of the conditions is met, the optional region will be displayed.
      E.g. cond="field1=0 || field2=1 || field3=0"
    • or use the javascript '&&' (meaning AND) logical operator. If any of the conditions is not met, the optional region will be hidden.
      E.g. cond="field1=0 && field2=1 && field3=0"
  • Avoid mixing '||' and '&&' logical operators in a single optional region condition. This may produce unexpected results. 

Modify optional regions parameters

You can edit optional region settings after you’ve inserted the region in a newsletter. For example, you can change whether the default setting for the content is to be displayed or not.

Using Adobe© Dreamweaver©:

  1. In the Document window, do one of the following:
    • In Design view, click the template tab of the optional region you want to modify.
    • In Design view, place the insertion point in the template region; then in the tag selector at the bottom of the Document window, select the template tag, <mmtemplate:if>.
    • In Code view, click the comment tag of the template region you want to modify.
  2. In the Property inspector (Window > Properties), click Edit.
  3. In the Basics tab, enter a name for the parameter in the Name box. 
  4. If you want to write an expression to control the display of an optional region, click the Advanced tab, select Enter Expression, then enter the expression in the box.
  5. Click OK.

Testing optional regions

To test optional regions, check the Test with first row check box in the Distribution list tab of your campaign details and verify that the test you receive fit all set conditions regarding the associated values of you recipient list first record.