5 Replies Latest reply on May 18, 2018 12:14 PM by Paul Donders

    Merge Fields in Email Alert on Closed Incident not working

    Seoid Ni Laoire

      Hi,

       

      I have set up an email alert to auto-reply if an email is logged in a closed CSR.  When I Send Test and Verify Merge Fields, the merge fields fill in correctly. 

      But when the email is fired from the workflow rule / email alert, the merge fields do not populate.

       

      Send Test and Verify Merge Fields

      Email Alert

      Any idea what's going on?

       

       

      Here is the VisualForce Template:

       

      <messaging:emailTemplate subject="Incident #{!relatedto.Name} (Ref:IN:{!relatedto.Name}) Incident Closed" recipientType="User" relatedToType="BMCServiceDesk__Incident__c">

      <messaging:htmlEmailBody >

      <html>

         <body>

      Dear user, <br></br>

      <br></br>

      Incident '{!relatedto.Name}' was closed on:   <apex:outputText value="{0,date,M/d/yyyy h:mm a z}"><apex:param value="{!relatedto.BMCServiceDesk__closeDateTime__c}" /></apex:outputText> and therefore additional handling on this incident is not possible. 

      <br></br>

      If you require assistance from Central Support, please raise a new ticket. Tickets can be raised via the Client Portal: https://helpdesk-aspiretechnology.secure.force.com.

      <br/>

      <br/>

      <br></br>

      <b><i>NOTE: Please do not edit the subject line in replies.</i></b>

      <br/>

      <br></br>

        Incident Details:

      <br></br>

      <br></br>

        <b>Incident Description:</b> {!relatedto.CSR_Slogan__c}<br/>

        <b>Client Name:</b> {!relatedto.BMCServiceDesk__Client_Name__c}<br/>

        <b>Open Date:</b> <apex:outputText value="{0,date,M/d/yyyy h:mm a z}"><apex:param value="{!relatedto.BMCServiceDesk__openDateTime__c}" /></apex:outputText><br/>

        <b>Network:</b> {!relatedto.Configuration_ItemL1__c}<br/>

        <b>Node:</b> {!relatedto.Node_with_versions__c}<br/>

        <b>Impact:</b> {!relatedto.BMCServiceDesk__Impact_Id__c}<br/>

        <b>Urgency:</b> {!relatedto.BMCServiceDesk__Urgency_ID__c}<br/>

        <b>Priority:</b> {!relatedto.BMCServiceDesk__Priority_ID__c}<br/>

      <br/>

      </html>

      </messaging:htmlEmailBody>

      </messaging:emailTemplate>

       

       

      Thanks,

       

      Seoid

        • 1. Re: Merge Fields in Email Alert on Closed Incident not working
          Paul Donders

          At least on line 4 you open "body' but never close it.

           

          Add </body>

           

           

          ...

          ....

          ....

          <b>Priority:</b> {!relatedto.BMCServiceDesk__Priority_ID__c}<br/>

          <br/>

          </body>

          </html>

          </messaging:htmlEmailBody>

          </messaging:emailTemplate>

           

          Hope this works already..

          • 2. Re: Merge Fields in Email Alert on Closed Incident not working
            Seoid Ni Laoire

            Hi Paul,

             

            Sorry my fault there - I deleted a sensitive part of the email template to post on the communities - accidentally deleted the </body>.

             

            Below is the correct version: it already contains </body>.

             

            <messaging:emailTemplate subject="Incident #{!relatedto.Name} (Ref:IN:{!relatedto.Name}) Incident Closed" recipientType="User" relatedToType="BMCServiceDesk__Incident__c">

            <messaging:htmlEmailBody >

            <html>

               <body>

            Dear user, <br></br>

            <br></br>

            Incident '{!relatedto.Name}' was closed on:   <apex:outputText value="{0,date,M/d/yyyy h:mm a z}"><apex:param value="{!relatedto.BMCServiceDesk__closeDateTime__c}" /></apex:outputText> and therefore additional handling on this incident is not possible. 

            <br></br>

            If you require assistance from Central Support, please raise a new ticket. Tickets can be raised via the Client Portal: https://helpdesk-aspiretechnology.secure.force.com.

            <br/>

            <br/>

            <br></br>

            <b><i>NOTE: Please do not edit the subject line in replies.</i></b>

            <br/>

            <br></br>

              Incident Details:

            <br></br>

            <br></br>

              <b>Incident Description:</b> {!relatedto.CSR_Slogan__c}<br/>

              <b>Client Name:</b> {!relatedto.BMCServiceDesk__Client_Name__c}<br/>

              <b>Open Date:</b> <apex:outputText value="{0,date,M/d/yyyy h:mm a z}"><apex:param value="{!relatedto.BMCServiceDesk__openDateTime__c}" /></apex:outputText><br/>

              <b>Network:</b> {!relatedto.Configuration_ItemL1__c}<br/>

              <b>Node:</b> {!relatedto.Node_with_versions__c}<br/>

              <b>Impact:</b> {!relatedto.BMCServiceDesk__Impact_Id__c}<br/>

              <b>Urgency:</b> {!relatedto.BMCServiceDesk__Urgency_ID__c}<br/>

              <b>Priority:</b> {!relatedto.BMCServiceDesk__Priority_ID__c}<br/>

            <br/>

             

             

            <br></br>

            Thank you,<br/>

            Central Support

            <br/>

            <br></br>

             

             

                </body>

            </html>

            </messaging:htmlEmailBody>

            </messaging:emailTemplate>

            • 3. Re: Merge Fields in Email Alert on Closed Incident not working
              Seoid Ni Laoire

              I've tested this using another email template (which I know works) - the same thing happens.

              Therefore it can't be the template.

               

              Is the something to do with the Incident being closed?  Is it only possible to send email alerts using Merge Fields for an open ticket?

              • 4. Re: Merge Fields in Email Alert on Closed Incident not working
                Paul Donders

                Is the receiver allowed to see the fields/values? Like permissionset client assigned and Client in the ticket?

                 

                Paul Donders

                InfraVision

                • 5. Re: Merge Fields in Email Alert on Closed Incident not working
                  Paul Donders

                  Ps how are you testing this? With a real test ticket?

                   

                   

                  Paul Donders

                  InfraVision