Wix Custom Form: Works except for customer response email

I’ve created a custom form that connects to a dataset. It works well and I receive the acknowledgement email reliably and quickly. However, the customer email is never created. What am I missing?

BTW, I’ve already watched the 2 videos on YouTube (How To Send An Email Notification After Form Submission in Wix - Wix Code Tutorial and How to add Wix Code Form Email Notifications) and read this article;
https://support.wix.com/en/article/corvid-tutorial-sending-an-email-on-form-submission

Thanks in advance for your help!


//email.jsw

import {sendWithService} from ‘backend/sendGrid’;

export function sendEmail(subject, body) {
const key = “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”;
const sender = “aai@accessability.org”;
const recipient = “sales@accessability.org”;
return sendWithService(key, sender, recipient, subject, body);
}

export function sendEmailWithRecipient(subject, body, recipient) {
const key = “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”;
const sender = “aai@accessability.org”;
return sendWithService(key, sender, recipient, subject, body);
}

//sendGrid.js

import {fetch} from ‘wix-fetch’;

export function sendWithService(key, sender, recipient, subject, body) {
const url = “https://api.sendgrid.com/api/mail.send.json”;

const headers = {
“Authorization”: "Bearer " + key,
“Content-Type”: “application/x-www-form-urlencoded”
};

const data = from=${sender}&to=${recipient}&subject=${subject}&text=${body};

const request = {
“method”: “post”,
“headers”: headers,
“body”: data
};

return fetch(url, request)
.then(response => response.json());
}

//PAGE CODE

import {sendEmail, sendEmailWithRecipient} from ‘backend/email’;

$w.onReady(function () {
$w(“#dsaabsi”).onAfterSave(sendFormData);
});

function sendFormData() {
const subject = Query about AABSI from ${$w("#input1").value};
const body = Query Details: ${$w("#input1").value} \rFirst Name: ${$w("#input1").value} \rLast Name: ${$w("#input2").value} \rEmail: ${$w("#input3").value} \rPhone: ${$w("#input4").value} \rContract Manufacturing and Assembly: ${$w("#checkbox1").checked} \rCommunity Employment: ${$w("#checkbox5").checked} \rImagine Design: ${$w("#checkbox3").checked} \rMRF: ${$w("#checkbox4").checked} \rDocument and Data Destruction: ${$w("#checkbox6").checked} \rOther: ${$w("#checkbox2").checked} \rOther Service: ${$w("#input6").value} \rComment: ${$w("#textBox1").value};

const recipient = $w(“#input1”).value;

sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));

sendEmail(subject, body)
.then(response => console.log(response));
}


function sendFormData() {
const subject = Query about AABSI from ${$w(" [#input1](https://www.wix.com/corvid/forum/search/~num~input1) ").value};
const body = Query Details: ${$w(" [#input1](https://www.wix.com/corvid/forum/search/~num~input1) ").value} \rFirst Name: ${$w(" [#input1](https://www.wix.com/corvid/forum/search/~num~input1) ").value} \rLast Name: ${$w(" [#input2](https://www.wix.com/corvid/forum/search/~num~input2) ").value} \rEmail: ${$w(" [#input3](https://www.wix.com/corvid/forum/search/~num~input3) ").value} \rPhone: ${$w(" [#input4](https://www.wix.com/corvid/forum/search/~num~input4) ").value} \rContract Manufacturing and Assembly: ${$w(" [#checkbox1](https://www.wix.com/corvid/forum/search/~num~checkbox1) ").checked} \rCommunity Employment: ${$w(" [#checkbox5](https://www.wix.com/corvid/forum/search/~num~checkbox5) ").checked} \rImagine Design: ${$w(" [#checkbox3](https://www.wix.com/corvid/forum/search/~num~checkbox3) ").checked} \rMRF: ${$w(" [#checkbox4](https://www.wix.com/corvid/forum/search/~num~checkbox4) ").checked} \rDocument and Data Destruction: ${$w(" [#checkbox6](https://www.wix.com/corvid/forum/search/~num~checkbox6) ").checked} \rOther: ${$w(" [#checkbox2](https://www.wix.com/corvid/forum/search/~num~checkbox2) ").checked} \rOther Service: ${$w(" [#input6](https://www.wix.com/corvid/forum/search/~num~input6) ").value} \rComment: ${$w(" [#textBox1](https://www.wix.com/corvid/forum/search/~num~textBox1) ").value};
const recipient = $w(" #input1 ").value; // This needs to be email value and not first name value

As stated on all the Wix Tutorial for it.

function sendFormData() {
const subject = New Submission from ${$w("#nameInput").value};
const body = Name: ${$w("#nameInput").value} \rEmail: ${$w("#emailInput").value} \rSport: ${$w("#sportDropdown").value} \rComments: ${$w("#commentsInput").value};
const recipient = $w(“#emailInput”).value;

Thank you so much! It all makes sense now.

Thanks, givemeawhisky - ginger ale on the side, and don’t be stingy, baby!