Skip to content
edoobox Docs
Try for free Try it for 7 days, no obligation
Menu
Try for free Try it for 7 days, no obligation

Customize email templates with IF and EACH

With IF, you display content only when a condition is met. With EACH, you repeat a section for multiple persons or dates. Both functions can be used in email and PDF templates if the relevant sending or document process provides the data.

Writing IF correctly

{IF?Variable = Wert}Content when matched{ELSE}Alternative{ENDIF}

Use the variable name without double hashes on the left, followed by a space, the operator, and the comparison value. You continue to write the value to be output as ##Platzhalter##. Comparison texts are written without additional quotation marks. {ELSE} is optional; without ELSE, nothing is output if the result does not match.

Keep a complete IF block in the HTML source code on one line. Use <p>…</p> or <br> within it for visible paragraphs. An actual line break inserted within the IF block can prevent detection. The following IF examples are therefore each written on one line.

OperatorMeaningExample
=Values are equal.{IF?OfferCurrency = CHF}…{ENDIF}
!=Values are not equal; also for an empty comparison value.{IF?MembershipPaymentUrl != }…{ENDIF}
>, <, >=, <=Numerical comparison; only with suitable numbers.{IF?MaximumMember >= 20}…{ENDIF}
INThe left list contains all values named on the right.{IF?OfferTags IN online,deutsch}…{ENDIF}
NOTINThe left list contains none of the values named on the right.{IF?OfferTags NOTIN online,hybrid}…{ENDIF}

AND, OR, ELSEIF, bracket expressions, and regular expressions are not part of the supported IF syntax. Use multiple short independent rules. Nested IF blocks or nested EACH blocks are not reliably supported for these templates.

Check optional values and second variable

An optional link should only appear together with its accompanying text:

{IF?MembershipPaymentUrl != }<p><a href="##MembershipPaymentUrl##">Pay for the renewal</a></p>{ENDIF}

For an empty comparison value, the area after the operator remains empty. Do not write "" there. A missing value is treated as a non-existent value in this check.

With $[AndereVariable], you use a second available variable as the complete comparison value:

{IF?OfferStartDate = $[OfferEndDate]}<p>Date: ##OfferStartDate##</p>{ELSE}<p>Period: ##OfferStartDate## to ##OfferEndDate##</p>{ENDIF}

Both variables must belong to the context. Do not combine the dynamic reference with further text. Formatted date or monetary amounts are not suitable for numerical size comparisons; do not compare date strings with > or <.

Using tags and tag values

OfferTags contains the tag names linked to the current offer. The IF check compares names. You output a saved tag value with ##Tag[Tagname]##.

{IF?OfferTags IN online}<p>Platform: ##Tag[Plattform]##<br>Access: ##Tag[Zugangslink]##</p>{ELSE}<p>We look forward to welcoming you in person.</p>{ENDIF}

For this example, create the tags online, Plattform and Zugangslink on the offer and enter suitable values for the last two. Personal identification in a participant link cannot be replaced by one tag value shared by everyone.

Multiple comma-separated names must all be included for IN. For NOTIN, none may be included. Spaces directly around the individual comma-separated names are removed; online,deutsch and online, deutsch are therefore equivalent. The spelling and capitalization of the tag names must match the saved values.

IN is a list check. {IF?OfferName IN Kurs A,Kurs B} does not check an offer name against multiple alternatives because OfferName is not a list. If the list is missing, IN is not met; NOTIN is met.

Distinguish between UserTags and booking permissions

UserTags contains the tags effective for the person from the profile, assigned bookings, and SAML. Past bookings can also contribute. Positive or negative booking conditions determine bookability and are not proof of a current payment or subscription status.

{IF?UserTags IN grundkurs}<p>You can start with the materials for the advanced course.</p>{ELSE}<p>Our team can help you choose a course.</p>{ENDIF}

Use UserTags for clearly defined characteristics. For an actual active participant subscription and an eligible price category, use the price category’s subscription conditions. A tag named «Mitglied» does not check this subscription entitlement.

Output mobile phone with a fallback value

Select both placeholders from the specific template’s menu. In this example, a custom visible participant field is named Mobiltelefon and offered as UserMobiltelefon. UserPhone is the visible standard telephone field. Replace the custom name with the name actually offered in your account:

{IF?UserMobiltelefon != }<p>Phone: ##UserMobiltelefon##</p>{ELSE}<p>Phone: ##UserPhone##</p>{ENDIF}

The first variant is only used if the mobile field is not empty; otherwise, the standard field is used. This checks neither reachability nor phone number format. Check a person with both numbers, one with only the standard field, and one without both values. If both are empty, the output number remains empty; capture or clean up the data before sending. An invented UserMobiltelefon does not make an additional standard field available.

For exclusively the year of birth, use the format variant [Y] on the visible date field; the exact process is described under Formatting date fields.

EACH and the values within a loop

{EACH?Listenname}<p>##FeldDerZeile##</p>{ENDEACH}

Write the list name immediately after the question mark. Each data set repeats the enclosed content once. A missing or empty list produces no content. Paragraphs, list items, or table rows within the block determine the visible separation.

Within the loop, the values of the current row apply. General values such as CompanyName remain available, provided the context provides them. If a row field has the same name as a general value, the row value takes precedence within the loop. The row fields are not available as a single current person outside the EACH block.

A list of individual text values, for example OfferTags, provides the field value within the loop:

{EACH?OfferTags}<p>##value##</p>{ENDEACH}

This example outputs the tag names linked to the offer. Use it only if these names are intended for the recipients.

List booking participants with price category

BookingUsers provides the persons of the booking. Within the loop, Id, Salutation, Firstname, Lastname, Email, and Pricecategory are available.

{EACH?BookingUsers}<p>##Salutation## ##Firstname## ##Lastname## – ##Pricecategory##</p>{ENDEACH}

A corporate booking for two people can, for example, show «Alex Example – Standard» and «Robin Example – Subscription rate» in separate paragraphs. The output describes the booked rate; subscription eligibility is checked during booking. Use the loop in a template with booking context and test individual and group bookings.

Output instructors and their email addresses

OfferLeaders collects instructors from the offer’s dates. People assigned more than once are combined. Use name for names and leaderemail for contact addresses. An IF condition inside the loop can handle a missing address:

{EACH?OfferLeaders}<p>##name##{IF?leaderemail != } – ##leaderemail##{ENDIF}</p>{ENDEACH}

The email address can be used as leaderemail only within this loop context. For the instructor of the first relevant session, use ##Teacher_first_module_email##. For lesson bookings, the first booked session may be decisive.

For an image, leaderavatar, leaderavatarurl, and leadername are available in the avatar context. Check persons without an image and output an image only if one exists:

{EACH?OfferLeaders}<p>##name##</p>{IF?leaderavatar = 1}<img src="##leaderavatarurl##" alt="##name##">{ENDIF}{ENDEACH}

List the dates of a location

A location notification provides the list Dates. This example belongs in the email template of the location rule itself:

<h2>##PlaceName##</h2>
{EACH?Dates}<p><strong>##OfferName##</strong><br>##Start_date##, ##Start_time## to ##End_time##<br>##Place##, room ##Room##</p>{ENDEACH}

Note the underscores and the different spelling compared to ICS placeholders. Further fields and the selection of dates are explained in Location-related email notifications.

Check examples in your own workflow

  1. First, select the specific email or PDF template and language.
  2. Insert a short block and save it.
  3. Check a fulfilled and an unfulfilled condition as well as empty optional values.
  4. For EACH, check zero, one, and multiple rows; compare names, price categories, and empty course leader contacts.
  5. Generate the actual document or a message to an internal demo person. Check the PDF and outbox.

If a block remains visible or disappears unexpectedly, check the complete start/end markers, the exact spelling, the data context, and for IF actual line breaks in the source code. The preview does not contain all lists and may therefore show an empty loop area.

Retain markers and field names when inserting

Use the markers in the examples exactly in uppercase: {IF?…}, {ELSE}, {ENDIF}, {EACH?…}, and {ENDEACH}. Variable and field names must also be adopted exactly. There must be a space between the variable name and the operator. For example, write {IF?OfferCurrency = CHF} and not {IF?OfferCurrency=CHF}.

The combination shown IF within EACH is suitable for an optional value of the current row. Two nested IF blocks or two nested EACH loops cannot be reliably expressed with this syntax. Keep such cases in separate, short blocks.

A list like OfferLeaders is intended for EACH; do not output it as text with ##OfferLeaders##. Within BookingUsers, use Firstname and Lastname; UserFirstname still refers to the participant person of the outer message context.

Observe the names of output tags

The condition OfferTags IN online checks a tag name. For ##Tag[Zugangslink]##, the character rules of the attribute notation also apply. Use a simple name without umlauts, commas, or the commercial ampersand for this. The complete explanation is under Output tag values with suitable names.

Certificate with course leader, signature, and additional logo

A common certificate layout should additionally show the logo of a partner organization for certain offers. The course leader comes from the assigned dates, and the logo selection from a deliberately set offer tag.

  1. Assign the responsible course leaders to the dates. Check their profile and, if desired, the saved signature graphic.
  2. Under system templates, open the Zertifikat.pdf attachment in the required language. Insert instructor names through Teacher_first_module or the OfferLeaders loop explained above. Use ##LeaderSignature## for saved instructor signatures.
  3. Insert the additional logo as an image in the template editor. Assign the normal tag partnerlogo to the relevant offers. Set the IF markers around the image generated by the editor in the HTML source code.
  4. Save and generate one actual certificate for an offer with and without this tag. Also check multiple course leaders and a leader without a signature graphic.
{IF?OfferTags IN partnerlogo}<p>[The additional logo inserted in the editor appears here.]</p>{ENDIF}

The text in square brackets is only an insertion aid: replace it with your image in the editor; it is not an edoobox placeholder. Keep the full IF block on one source line. For a general email with instructors, use the instructor loop; LeaderSignature belongs to the certificate context.

LeaderSignature can output multiple assigned course leaders. If their signature graphic is missing, edoobox uses a designed name display. An image or this lettering is not a cryptographic digital signature. The Certificate validation with number and URL and the Rules for attendance and certificate dispatch are set up separately.

Place a fixed second signature next to the course leader

A fixed signature, for example of the training director, is maintained as an image in the template. LeaderSignature, on the other hand, provides the signatures of the actually assigned course leaders. A second fixed signatory is not automatically selected by this placeholder.

  1. Copy the working certificate layout and open the desired language variant.
  2. Insert a simple table with one row and two equally wide cells in the PDF editor. Use the table for alignment and hide its borders.
  3. Place ##LeaderSignature## and the appropriate label on the left. Insert the fixed signature graphic on the right via the image function and write the name or function below it.
  4. Set the image width, cell spacing, and alignment so that both blocks fit within the available page width. Do not use a sequence of spaces for alignment. With multiple dynamic course leaders, the left cell may receive more content.
  5. Generate an actual PDF with one and with multiple course leaders as well as with a leader without a saved graphic. Check the height, page break, and position over an existing letterhead.

The fixed image remains the same for all documents of this template. If the signing person changes, update the image and label deliberately. This design aligns images and texts; it does not add a cryptographic signature to the PDF.

Output topic area and further offer values

A topic area, an internal recognition number, or the designation of an offer group are not automatically additional standard placeholders. Use Tags with values or the Additional texts for information that varies per offer. OfferType refers to the configured offer type, for example course or seminar, and does not provide an arbitrary category path.

Example: Create a normal tag and fill in the separate fields: Name Themenbereich, Value Projektmanagement. Assign this tag to the specific offer. In the following block, the name check prevents an empty labeled line for offers without this tag:

{IF?OfferTags IN Themenbereich}<p>Topic: ##Tag[Themenbereich]##</p>{ENDIF}

For contact information of the course leader, use ##Teacher_first_module_email## for the first relevant date or leaderemail within OfferLeaders. A custom field of the admin profile not offered in the editor does not become available just by writing its name between double hashes. Deliberately create missing general offer information as a tag value or additional text and check it in each required language variant.

Output salutation and academic title separately

UserTitle is used for a salutation; the name is not a reliable placeholder for an academic title such as «Dr.». A title in the profile of a course leader is also not a separate participant field and is not automatically copied into their participant data.

To collect participants’ academic titles, use a custom visible participant data field, for example named Akademischer Titel, and add it to the required form. Select its actual placeholder in the specific template’s menu. Use the following example unchanged only if the placeholder there is named UserAkademischerTitel:

<p>{IF?UserAkademischerTitel != }##UserAkademischerTitel## {ENDIF}##UserFirstname## ##UserLastname##</p>

The title and its following space appear only when the field is filled. Check a person with and without a title as well as a group registration: The name and title must belong to the person actually output. For a leader in the public profile, separately check the Profile data and display options of the course leader. The values of a deviating billing address must not be mixed with the participant title.

Design a participation certificate for employer or educational leave

An organization requires a participation certificate with the offer designation, period, attendance, and own recognition details after the course. Use the existing certificate attachment if it should follow the normal attendance and dispatch process. For an independent document purpose, create a custom PDF template and check its actual data context.

If you need the employer from registration, first check the visible standard Company field. For a custom value, activate an unused participant field slot, name it for example «Arbeitgeber», and connect it to a suitable input in the participant form. Insert its offered participant placeholder through the PDF template menu. For a group registration, the document must use the actual participant’s data; do not copy the contact’s company to everyone without checking.

In the certificate attachment, you can use the offered participant fields, OfferName, OfferStartendDate, and VisitingTimesPercent. Add two self-maintained normal offer tags. For the first tag, enter Bundesland in Name and Beispielland in Value. For the second, use Anerkennungsnummer in Name and DEMO-2026-001 in Value. The two names are freely chosen tags and not special edoobox recognition fields:

<p>Participation in ##OfferName##, ##OfferStartendDate##.</p>{IF?OfferTags IN Bundesland}<p>Scope: ##Tag[Bundesland]##</p>{ENDIF}{IF?OfferTags IN Anerkennungsnummer}<p>Recognition number: ##Tag[Anerkennungsnummer]##</p>{ENDIF}

Maintain only the details that apply to the specific offer. The output of a number or a federal state does not confirm official recognition; check its content and validity based on your documents. Before dispatch, compare the details, recorded attendances, and desired confirmation threshold. A certificate from a batch file has different selection rules than the automatic email attachment. For lesson selection, also check the Difference between total period and actually booked dates.

Select recognition details based on the region of a person

For the same event, persons may need different regional proofs. The selection then belongs to a participant field; a single offer tag would output the same value for everyone.

  1. Activate a custom text field named Anerkennungsregion. Connect it in the participant form to a selection list, for example Region A, Region B and Keine. Check the saved values, including for group participants.
  2. Maintain separate normal tags on the specific offer with the fields Name AnerkennungRegionA, Value DEMO-A, and Name GueltigRegionA, Value the checked validity text. Create the corresponding values for Region B under AnerkennungRegionB and GueltigRegionB.
  3. Select the custom participant placeholder in the PDF menu. Only if it is exactly called UserAnerkennungsregion there, use the following notation unchanged.
{IF?UserAnerkennungsregion = Region A}<p>Recognition: ##Tag[AnerkennungRegionA]##; Validity: ##Tag[GueltigRegionA]##</p>{ENDIF}{IF?UserAnerkennungsregion = Region B}<p>Recognition: ##Tag[AnerkennungRegionB]##; Validity: ##Tag[GueltigRegionB]##</p>{ENDIF}{IF?UserAnerkennungsregion = Keine}<p>Proof of attendance without a regional recognition statement.</p>{ENDIF}

There are three independent conditions on a single selection value. An unknown or empty value selects no recognition; clarify it before document creation. Check two persons of the same offer with different regions and one without recognition need. Check name, region, offer values, and attendances per person. The template does not check official validity and does not extend it automatically.

If the additional texts are already in use, you can maintain a general offer link as a normal Tag with value. This value belongs to the offer and can be output in an email with the appropriate offer context. It is not an additional participant field.

  1. Open the specific offer and create a normal tag with the separate details Name Feedbacklink and Value https://example.org/umfrage/demo. Use a unique value of this name per offer.
  2. Open the desired reminder or custom email template and add the following block. It shows the accompanying text only if the tag name exists.
  3. For the next offer, save the same tag name with its own survey address. Offers without this tag do not receive the additional block.
  4. Generate a message for both offers and for an offer without the tag. Open the links from the actual message and check the survey target. Additionally, check whether the email task provides the required offer context.
{IF?OfferTags IN Feedbacklink}<p>Your feedback: <a href="##Tag[Feedbacklink]##">Go to the survey</a></p>{ENDIF}

The tag value is used for the entire offer; it does not automatically select a different link per person or booked lesson. For individual access, use the personal link of the respective system provided for this purpose. A copied offer link does not replace its personal login. A tag with an empty or incorrect URL value must be corrected before dispatch; the IF check of the name does not validate the target address.

Two features, one priority, and a default case

An organization uses the tags vertiefung and online. For both, the in-depth survey should take priority; only for online the online survey, otherwise the standard survey. Two independent positive IF blocks would output two links for both tags. Nested IF blocks and an invented AND or ELSEIF are not a reliable solution for this.

Therefore, decide on the one desired link when preparing the offer and save it in the normal tag with Name Feedbacklink and Value the complete URL:

Features of the offerFeedback link to be entered
vertiefung, including when combined with onlineURL of the in-depth survey
Only onlineURL of the online survey
Neither of the two featuresURL of the standard survey
{IF?OfferTags IN Feedbacklink}<p><a href="##Tag[Feedbacklink]##">Give feedback</a></p>{ELSE}<p>Contact our team for information about giving feedback.</p>{ENDIF}

The same procedure works for three different texts: choose exactly one text according to the table and save it as a normal tag with Name Hinweistext and Value set to the selected in-depth, online or standard text. Output ##Tag[Hinweistext]## in the appropriate offer context. Check no tag, only vertiefung, only online and both; with both, exactly the in-depth text must appear. This priority is also determined while maintaining the offer, not evaluated by a nested IF.

Only one value of this link tag should exist per offer. Multiple values of the same name are otherwise output comma-separated and do not result in a reliable single link. If you change the features later, also check the selected link. The ELSE text is the understandable fallback case for a missing tag, not a check of an empty or incorrect URL.

Link an external feedback form with the attendance confirmation

A custom participant form collects booking or profile data. An additional question belongs to the registration. This does not create a freely designable edoobox survey generator for subsequent feedback. Create a follow-up survey in the desired external form system and maintain its link per offer as above.

  1. Adopt the published external form address and check it without admin login.
  2. If the form supports fixed parameters, generate a complete, correctly coded URL there, for example https://example.org/feedback?angebot=demo&sprache=de. Save this entire URL as the value of Feedbacklink.
  3. Open the system template of the attendance confirmation email and insert the link block in each required language. Check the actual offer context, the attendance threshold, and the dispatch time.
  4. Generate an internal test case and open the link from the received message. Check the form, offer assignment, and passed parameters.

edoobox does not automatically convert arbitrary participant values within a URL into the corresponding parameters of the external form system. Names, email addresses, or text values containing spaces require its defined mapping and URL encoding. Use a deliberately configured integration for this purpose instead of appending placeholders to a URL without verification. The sent link is not proof that a response has been filled out.

Related guides