NS User
07/01/2025, 9:41 PMCeligo AI
07/01/2025, 9:42 PMAI generated answer (using internal Slack threads):To display the email template content in the Brazil language, you would need to create a separate email template in the desired language (Brazilian Portuguese in this case) and then use it when the criteria are met. Here is a basic example of how you can send an email with a custom-defined template using SuiteScript 2.0:
javascript
var emailTemplate = render.createTemplateRenderer();
emailTemplate.templateContent = '<html><body>Hello, {name}</body></html>'; // Load your Brazilian Portuguese template here
emailTemplate.addCustomDataSource({
alias: 'name',
format: render.DataSource.OBJECT,
data: { name: 'John Doe' }
});
var emailBody = emailTemplate.renderAsString();
email.send({
author: 123, // Internal ID of the author
recipients: '<mailto:recipient@example.com|recipient@example.com>',
subject: 'Test Email',
body: emailBody
});
In this example, the render.createTemplateRenderer()
function is used to create a new template renderer. The templateContent
property of the TemplateRenderer
object is then set to the content of the email template. The addCustomDataSource()
method is used to add a custom data source to the template renderer, which can be used to replace placeholders in the template with actual data. The renderAsString()
method is then used to render the template as a string, which can be used as the body of the email.
Please note that you would need to replace the '<html><body>Hello, {name}</body></html>'
string with the actual content of your Brazilian Portuguese email template, and the {name: 'John Doe'}
object with the actual data that you want to insert into the template.
******
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
07/01/2025, 9:42 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82705909
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820649207
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817205787
Celigo AI
07/01/2025, 9:42 PM