function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Girijesh GowdaGirijesh Gowda 

SimpleEmail

Hi Team,

I'm currently using the Simple Email API (/services/data/v58.0/actions/standard/emailSimple) for sending emails. I'm passing "emailTemplateId" (Template Id), "recipientId" (ID of a Contact), and setting "logEmailOnSend" to true. However, every time I try to test, I receive the following exception:

"errors": [
    {
        "statusCode": "UNKNOWN_EXCEPTION",
        "message": "An error occurred. Try again, or contact Salesforce Customer Support and provide this error ID: 1057582836-221577 (1125190724)",
        "fields": []
    }
]
Even when I test with only "emailTemplateId" and "recipientId," the same exception occurs.

I've attempted this with multiple accounts, but the result is the same. When I try with version 57 and lower, I get the following error:

[
    {
        "statusCode": "UNKNOWN_EXCEPTION",
        "message": null,
        "fields": []
    }
]
I'm not sure what's causing this issue. Could someone please help? Your assistance would be greatly appreciated.

Thank you.
Best Answer chosen by Girijesh Gowda
HarshHarsh (Salesforce Developers) 
Hi Girijesh,

Please follow the workaround given in the below-known issue link.
https://issues.salesforce.com/issue/a028c00000tJBCQ/emailsimple-action-throws-unknown-exception-when-called-from-api-with-logemailonsend-param-as-true-or-emailtemplateid-param-is-present
 
Please mark it as Best Answer if the above information was helpful.

Thanks.