Customizing FSM Notification Emails

The body.template property selects the HTML FreeMarker template. Other properties within body supply its data.

This topic includes the following sections:

FreeMarker inserts those values and evaluates template directives to produce the HTML message. A service report PDF uses FreeMarker to produce XML. The Big Faceless Organization (BFO) Report Generator then generates the PDF. For the rendering stages and public BFO and FreeMarker references, see Preparing and Selecting Custom FSM Service Report Templates.

For searches supplied to body, match template references to the effective objectify setting. Native results use NetSuite search column names, and mapped results use the map's property names. For the setting, see Returning Mapped Values or Native Search Results. For examples of shared template-data behavior, see Field Names in Report Templates.

For additional JSON data that must preserve zero or false values, use a named object. For this rendering limitation and an example, see Adding Data to FSM Service Reports. If an email-data search can exceed 1,000 rows, check its retrieval limit. For more information, see FSM Search Retrieval Limits.

The following table distinguishes configuration template-tag context from the named data supplied to the HTML template.

Email Family

Configuration Tag Context

HTML Template Data

Case

supportcase

case

CRM Task

task

task

Project Task

projecttask

projecttask and project

Employee

employee

employee and FSM Mobile link as mobile.

For example, the case definition uses the configuration tag ${ supportcase.id } to load a case record under body.case. The HTML template accesses that supplied data as case.

Keep configuration template tags and FreeMarker template syntax distinct. For information about configuration tags, see FSM Expressions and Template Tags. For information about template syntax, refer to FreeMarker Manual.

Changing the CRM Task Email Template and Subject

This example changes the email template and subject and retains inherited task data and the service report PDF.

            {
  "notification": {
    "taskEmail": {
      "servicereport": {
        "subject": "Service report for task ${ task.id }",
        "body": {
          "template": "/SuiteScripts/Customer Templates/task-service-email.html"
        }
      }
    }
  }
} 

          
Note:

Before using this example, replace the File Cabinet path with the path to an existing template file in your account.

Copy the standard template before modifying it, and retain the data names used by the replacement template.

Use a complete HTML document with an <html> element. FSM adds a notification identifier to that element so a later duplicate check can find the sent message. If subject is omitted, include a suitable <title> to supply the subject.

To add content, supply it under a named property in body and reference that name in the HTML template. Adding data to body doesn't automatically add it to the PDF. PDF data is supplied separately under the attachment's contents object. For details, see Supplying Data to FSM Service Report Templates.

Configuring Recipients

Recipient collections can combine fixed addresses, template-tag values, and configured searches.

The standard recipient collections use array: true. For combining named values and searches, see Combining Search Results.

Adding a Copy Recipient to a CRM Task Service Report Email

The following fragment adds a carbon-copy recipient to the CRM Task service report email. It retains the standard primary recipient selection.

              {
  "notification": {
    "taskEmail": {
      "servicereport": {
        "cc": {
          "array": true,
          "serviceOffice": "service-office@example.com"
        }
      }
    }
  }
} 

            

Replace the example address with the intended address. Review the merged configuration for any existing cc properties: object merging retains those properties too.

Adding a property to the standard recipients object adds recipients without removing the existing case or customer recipient sources. The complete merged collection determines the recipients.

For recipient searches, see FSM Searches and Field Mapping. Use selective filters and return the email addresses required by the notification.

Configuring Attachments

The standard service emails define attachments.array: true and a named servicereport report definition. FSM resolves the collection, renders the report, and attaches the resulting PDF.

Additional File Cabinet files can be included by path. For PDF properties, XML templates, file names, and report data, see Report File Properties.

Adding a File to the CRM Task Service Report Email

The following fragment adds a file and retains the inherited service report attachment.

              {
  "notification": {
    "taskEmail": {
      "servicereport": {
        "attachments": {
          "array": true,
          "instructions": "/SuiteScripts/Customer Templates/service-instructions.pdf"
        }
      }
    }
  }
} 

            

Use an existing File Cabinet path. Keep the service report PDF first: the record's PDF preview returns the first rendered attachment.

Email and attachment sizes remain subject to the email limits in NetSuite. A successful PDF preview doesn't establish that the complete email can be sent with all attachments.

Language and Translations

When Multi-Language is enabled, service notifications first select the customer's language. If no customer language is available, notifications use the subsidiary's language, followed by the account's default language.

Employee notifications select the employee's language, then the subsidiary's language, then the account's default language.

When Multi-Language is disabled, notifications use the account's default language.

The selected language is used when rendering the email and its report attachments. The presence of a language setting doesn't translate arbitrary customer-written content. Check any custom template text and translation references in each intended language.

For information about report-template considerations, see Language and Translations.

Additional Information

Related Topics

General Notices