SAP Knowledge Base Article - Public

3452302 - Response template placeholder not working

Symptom

  • Response template placeholder not working with appointments
  • Users encounter problems with template placeholders, resulting in incorrect or missing data displayed within the generated content. 

Environment

  • SAP Service Cloud Version 2 1.0
  • SAP Sales Cloud Version 2 1.0

Reproducing the Issue

  1. Open Service Cloud V2
  2. Go to Activity Manager
  3. Search and open a meeting 
  4. Send outbound email to appointment invitees

Cause

  • Email Template Configuration issue
  • Typically, the #each helper is employed, akin to a for loop in programming languages.

Resolution

  • Adapt Email Templates:
    •  Customers must modify their email templates to accommodate one-to-many (1:n) relationships effectively.
    • The below are only an examples, which are provided as is.
    • It is the customer's responsibility to make further adjustments based on specific data structures and requirements.
  • Structure Templates Accordingly:
    • Use of Indexes:
      • Indexes need to be used along with placeholder names to fetch the desired values for attributes of type Array.
        • Examples:
          • Some examples using index include "{{attendees.[0].displayId}}", "{{attendees.[0].name}}", etc.
          • Below, you will also find examples using value. 
            • Using Index Example:
              {{#each attendees}}
              <b>Attendee ID:</b> {{id}}<br>
              <b>Name:</b> {{name}}<br>
              <b>Display ID:</b> {{displayId}}
              <br>{{/each}} <b>Note Content:</b> {{note.content}}
            • Explanation of Adapted Example:
              • {{#each attendees}}: Iterates through each attendee in the attendees array.
              • {{id}}, {{name}}, and {{displayId}}: Placeholder variables representing the respective attributes of each attendee.
              • {{/each}}: Ends the iteration over attendees.
              • {{note.content}}: Represents the content of the note associated with the appointment.
    • Using Value Example:
      • Assuming application to an appointment scenario, integration can be structured as follows:
           {{#each appointments}}
           <b>Appointment Details:</b><br><b>Appointment ID:</b> {{id}}<br>
             <b>Appointment Date:</b> {{date}}<br>
             <b>Attendees:</b><br>
             {{#each attendees}}
               - Attendee ID: {{id}}<br>
                 Name: {{name}}<br>
             {{/each}}
             {{#each notes}}
               {{#if (eq noteType "S000")}} 
                 <b>Note Details:</b><br>
                 Note created by ID: {{adminData.createdOn}}<br>
                 Note type: {{noteType}}<br>
                 Note content: {{content}}<br>
               {{/if}}
             {{/each}}
           {{/each}}
        • Explanation of Adapted Example: 
          •  The above example iterates through each appointment.
          • Within each appointment, it displays appointment details (ID, date) and iterates through each attendee, displaying their details (ID, name).
          • It then iterates through each note associated with the appointment.
          • Within the notes loop, it checks if the noteType is "S000".
          • If the condition is met, it displays the details of the note (creation date, type, content).

See Also

  • KBA 3434774 - Placeholder in Email Template is not populated with Desired Value 
  • KBA 3347427 - Unable to See Text Content Added to Email Body when Using Templates in Cases
  • Configure Email Templates

Keywords

Email, template, placeholders, Placeholder, Templates, Array, E-mail, appointment, cases  , KBA , CEC-CRM-TMP , Templates for SAP Sales/Service Cloud , Problem

Product

SAP Sales Cloud and SAP Service Cloud Version 2 1.0