Mail Merge: src property must be a valid json object

I encountered some problem with sending email. I followed this video Membership App - Mail Merges | Five.Co [Tutorial - Step 6 ] - YouTube to create a mail merge and then use five.executeAction to run it.

However, I got the error “src property must be a valid json object” when im trying to do so.

my code:
function sendEmail(five, context, result) {
const emailRun = five.executeAction(“sendEmail”, {“email”: “my email”, “name”: “applemint”})

return five.createError(emailRun, “Fail to send email”);
return five.success(result);

I’ll attach my mail settings and mail merge action below.
Thanks a lot.

mail merge:

mail setting:

Hello applemint,

  1. First, try changing the arguments from “email” and “name” to “SMTPToEmail” and “SMTPToName.”

  2. Ensure that your function is linked to an event prefixed with ‘Do’, such as ‘DoComplete’. This is because events beginning with ‘Do’ are server-side events, and they are capable of executing queries, mail merges, etc.

Let me know if these two steps don’t work and the error still persists.

Thanks for your reply. The function is currently linked to DoRun of the process “Send Email”. I have also tried to change the arguments base on the 1st step and it still shows the same error…

So I tried replicating your code and I am getting the same error but the mail merges are working as our errorCode is ErrErrorOk which means the mails should work as intended, can you try passing your actual email as an argument replacing “my email” and see if it’s working? keep the arguments as SMTPToEmail and SMTPToName