Hi all! email.send has a recipients field that I'v...
# suitescript
k
Hi all! email.send has a recipients field that I've always done as an internal ID number or a string or string[] or email addresses. Now it's giving me an error that recipients needs to be an object. What is expected here?
m
k
That's what I thought
WRONG_PARAMETER_TYPE: Wrong parameter type: options.recipient is expected as object.
the value I used is an email address string
m
should be
recipients
maybe post your code snippet?
☝️ 1
k
Ah ha! I bet it's not the email.send that's throwing the error but something else, because it is indeed
recipients
! Hunting down all occurrences of
recipient
instead...
Ah ok it's coming from render.mergeEmail
which DOES have recipient as an object
m
Oh yeah when using
render.mergeEmail
it is an object. It's also optional and you can set the recipients in
email.send
. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_454332824706.html#render.mergeEmail(options)
k
yeah I just gave it
{ type: 'customer', id: customerId }
👍 1
fixed it right up