Advanced placeholders

Genkgo uses placeholders in several places. For example, they are used for salutations above messages, sending username and password and for addresses. Placeholders indicate which information should be in which location. This makes it possible to, for instance, send personalized messages. Placeholders often refer to fields in the Organization.

Most of the time, simple placeholder suffice, such as {{uid}} and {{password}} for password e-mails. However, in some cases it may be more convenient to use advanced placeholders. With advanced placeholders, certain conditions can be added. Two examples of advanced placeholders are given beneath. One example concerns placeholders that determine what to do with empty fields. The other example concerns placeholders that target differences between groups.

Advanced placeholders regarding empty fields

In this example, we will look at addresses.

Suppose your community keeps visiting addresses as well as invoice addresses for company employees. If a field in the invoice address is empty and the invoice address cannot be used, the visiting address should be used instead. Advanced placeholders make this possible.

The purpose of these placeholders is to refer to other fields if one of the targeted fields is empty. You could see that as the condition of this type of placeholder. In the element ‘Fields & properties’, you can view the placeholders and with which fields they correspond. Below, the placeholders are used for a visiting address and an invoice address:

{{name}}
{{x_Invoicestreet="" street | x_ Invoicestreet }} {{x_Invoicestreet="" streetnumber | x_Invoicestreetnumber}}
{{x_Invoicestreet="" postalcode | x_Invoicepostalcode }}
{{x_Invoicestreet="" city | x_Invoicecity}}

One placeholder is located between the following two signs: {{placeholder}}. Therefore, the placeholders above consist of several elements. Take the placeholder in bold below. Each element has its own meaning. Together, they form a sort of command. The different elements are presented in the table below, with their meaning in the right column.

{{x_Invoicestreet="" street | x_ Invoicestreet }}

Element Meaning
{{ Begin placeholder
  IF
x_ Field in the Organizations
Invoice street Invoice street (name of the field in Organization)
= Is equal to
"" Empty
  THEN USE
street The placeholder that refers to 'street' (in the visiting address)
| If not, then use
x_ Field in the Organization
Invoice street Invoice street (name of the field in Organization)
}} End placeholder

If we read the meaning of the elements from top to bottom, the following command emerges:

  • “If the field in the Organization ‘Invoice street’ is empty, then use the placeholder ‘street’ (which refers to the visiting address street), but if the field ‘Invoice street’ is not empty, then use the value of field ‘Invoice street’”.

In sum, we instruct the system to use the street of the invoice address if this is accounted for in the Organization, but use the street of the visiting address if the invoice street is not specified.

You may have noticed that in the complete address above (in placeholders), the condition in each placeholder is that the field ‘Invoice address’ is empty, even when the information needed is for example the postal code (e.g. {{x_Invoicestreet="" postalcode | x_Invoicepostalcode }}). Thus the condition to use the invoice address is based on one single field. If this field (invoice street) is not filled in, the entire invoice address will not be used, but the visiting address will be used. This is a necessary condition to prevent mixed addresses.

When the placeholders above are used, the address will look as follows:

Company A
Street 10
1234AB
Amsterdam

Advanced placeholders for different groups

In this example, we will look at forms of address.

Suppose your community uses a special salutation for members when sending e-mails. Suppose also that this salutation is different for male members and female members. This means that there is a difference of salutation per group. Advanced placeholders can help with using different salutations for different groups.

The salutation you want to use can be ‘Mr./Mrs. Johnson’. In this case, the salutation depends on gender. First, you need to find the placeholder for gender in the Organization (let’s use ‘gender’ here). Then, you want to indicate when ‘Mr.’ should be used, and when ‘Mrs.’ should be used. When the gender is female, you want the salutation to say ‘Mrs.’. Behind ‘Mrs.’, you want the salutation to state the surname of the person. This is what the placeholders should look like:

{{gender=“male” “Mr.” | “Mrs.”}} {{surname}}

From left to right, the first placeholder forms the following command:

  • If the gender of the person is male, use ‘Mr.’, but if not, then use ‘Mrs.’.

Of course, this can be reversed as well:

{{gender=“female” “Mrs.” | “Mr.”}}

In that case, the placeholder forms this command:

  • If the gender of the person is female, use ‘Mrs.’, but if not, then use ‘Mr.’.

This way, these kind of advanced placeholders can be used to personalize salutations.