Hi, I am facing an UNEXPECTE_ERROR while calling e...
# suitescript
s
Hi, I am facing an UNEXPECTE_ERROR while calling email.send() API in a Scheduled Script. Does anyone has any idea that what could have been the cause(s) of this error. Using email.send() in a User Event script and that is working correctly. In attached screenshot, line 75 is email.send().
j
I get this if I'm sending to a recipient's internal id and they don't have an email address defined
👍 1
it's probably a good idea to log.debug the email configurations just before sending to make sure it's going to the right entity
👍 1
s
Also check the "sender". From a UE you might have it sent as the current user. But from a scheduled script "current user" is "System" which is not an employee and that will cause Unexpected Error. Good practise to have a dummy "No Reply" employee record (doesn't need NS access, just an email). And set it as a script preference.
👍 2