hi, I'am trying to send email using a template, bu...
# suitescript
t
hi, I'am trying to send email using a template, but I am getting this error. Sorry newbie here 🙈
b
share the code
or consider a support case
you would want to pass support that id
t
var mergeResult = render.mergeEmail({
templateId  : 1961,
customRecord: {
type  : 'customrecord87',
id    : 1602
}
});
so i just get the internal id of the template
and the id on the custom record is the id of the record itself
and here is where my template located
b
start at the template
t
ok, so i have created a template
b
obviously replace the id and try again
t
I still have this error
b
use the internal id number of the template
t
ok ill try that
b
your error message explicitly says that your string cannot be converted to an integer
t
oh ok.. my bad 😩 but one more thing, how can I pass the value inside the email ?
b
what value
t
value from my custom record, I want to reflect that on my email as well.
b
do you know how the templates work normally?
t
yes, right now I use the template. But what I want is to use my custom record values.
b
those would go in the template
usually using freemarker syntax
its more obvious from the template editor if you enable mail merge on your custom record
that will allow you to select the custom record as a field type so that you can insert fields using the ui
t
i forgot to send an update. It seems that my code is correct and the problem is my template.. hehe thanks @battk for pointing it out