eminero
02/25/2025, 4:21 PMCeligo AI
02/25/2025, 4:21 PMAI generated answer (using internal Slack threads):Yes, you can use system email templates in SuiteScript. You can use the
render.mergeEmail
method to merge an email template with a record. This method returns an object that contains the subject and body of the email, which you can then use to send the email.
Here is an example of how you can use it:
javascript
var mergeResult = render.mergeEmail({
templateId: 123, // replace with your template id
entity: {
type: record.Type.CUSTOMER,
id: 456 // replace with your record id
}
});
var emailSubject = mergeResult.subject;
var emailBody = mergeResult.body;
// send the email using N/email module
email.send({
author: 789, // replace with your author id
recipients: '<mailto:test@example.com|test@example.com>',
subject: emailSubject,
body: emailBody
});
Please replace the ids in the example with your actual ids.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/25/2025, 4:21 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.88158673
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858384907
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852413893
Celigo AI
02/25/2025, 4:21 PM