Context
Hello,
I'm encountering an issue when attempting to use the simpleEmail function via the REST API in Salesforce. The error message returned is as follows:
[
{
"actionName": "emailSimple",
"errors": [
{
"statusCode": "UNKNOWN_EXCEPTION",
"message": "An error occurred. Try again, or contact Salesforce Customer Support and provide this error ID: 1414428604-26203 (1457644238)",
"fields": []
}
],
"invocationId": null,
"isSuccess": false,
"outputValues": null,
"sortOrder": -1,
"version": 1
}
]
Here is the payload I'm using:
{
"inputs": [
{
"emailSubject": "Test Subject",
"emailBody": "This is a test email body.",
"emailAddresses": "[email protected]",
"logEmailOnSend": true,
"recipientId": "0019000000DmehKAAR"
}
]
}
Despite following the documentation, I'm not sure why this error is occurring. I've verified that the recipientId and emailAddresses are correct. Additionally, I am passing logEmailOnSend as true.
Questions:
- What could be the potential causes for the UNKNOWN_EXCEPTION error in this context?
- Are there any specific configurations or permissions that I might be missing?
- How can I resolve this error or get more detailed information about the cause? Any help or guidance would be greatly appreciated. Thank you!
(P.S. I hid recipientId with some sample Id, but I used leadId to which I wanted to send an email. I verified that email is indeed sent, when I set logEmailOnSend = False)
logEmailOnSendand useEmailMessageto log the email in lead's activity as a workaroundjava.lang.NullPointerException. Checking the stacktrace further....