EmailMergeResult Object Members in SuiteScript

The EmailMergeResult object encapsulates email merge results, including email body and subject for server scripts.

·2 min read·View Oracle Docs

The EmailMergeResult object serves as a key component within the N/render module for SuiteScript, allowing developers to manage email merge results effectively. This object provides essential properties such as the email body and subject, making it simple to control and utilize email distributions in automated scripts.

Overview of the EmailMergeResult Object Members

Properties

Property NameTypeDescription
EmailMergeResult.bodystring (read-only)Contains the body of the email distribution in string format.
EmailMergeResult.subjectstring (read-only)Contains the subject line of the email distribution in string format.

How to Use the EmailMergeResult Object

To create and return an EmailMergeResult object, you use the render.mergeEmail(options) method. Below is a sample of how to create an email merge result:

suitescript
1// Sample SuiteScript code to create an EmailMergeResult
2var mergeResult = render.mergeEmail({
3 templateId: 1234,
4 entity: {
5 type: 'employee',
6 id: 62
7 },
8 recipient: {
9 type: 'lead',
10 id: 41
11 },
12 supportCaseId: 2,
13 transactionId: 271,
14 custmRecord: null
15});

This sample demonstrates setting the necessary options, such as templateId, entity, and recipient, to successfully generate the email content you need.

Related Resources

For further details, check out the N/render module documentation and look into advanced scripting techniques using the TemplateRenderer object to enhance your email merge capabilities.

Who This Affects

This information is valuable for:

  • Developers creating automated email communications
  • Administrators managing scripts and templates within NetSuite

Key Takeaways

  • The EmailMergeResult object is essential for handling email distributions in SuiteScript.
  • It includes properties for the email body and subject, both read-only, which simplifies mail generation.
  • Utilize the render.mergeEmail(options) method to create the object effectively.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

How do you create an EmailMergeResult object in SuiteScript?
You can create an EmailMergeResult object using the render.mergeEmail(options) method. You need to provide specific options such as templateId, entity, recipient, supportCaseId, transactionId, and custmRecord.
What properties are available in the EmailMergeResult object, and what do they contain?
The EmailMergeResult object includes two main properties: body and subject. Both are read-only strings containing the body and subject of the email distribution, respectively.
Can the properties of the EmailMergeResult object be modified directly?
No, the properties of the EmailMergeResult object, namely body and subject, are read-only and cannot be directly modified.
Is the EmailMergeResult object applicable to both WMS and standard NetSuite environments?
The article does not specify if the EmailMergeResult object is specific to WMS or standard NetSuite, only that it is part of the N/render module for SuiteScript.
Source: EmailMergeResult Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Integration

View all Integration articles →