I would like to send 2 different emails on a form submission. Currently my Page Code looks like this:
//automatedEmails
import {sendEmail, sendEmailWithRecipient} from 'backend/newBooking';
$w.onReady(function () {
$w("#dataset1").onAfterSave(sendFormData);
});
function sendFormData() {
const subject = `Booking Confirmation`;
const body = `Hi ${$w("#input1").value},
\nWe have received your booking request for Product X.
\nOur Hotel Representative will be visiting you shortly to confirm your booking. If you wish to book another service simply go to https://www.concorde-excursions.com In the meantime we hope you are enjoying your vacation in Mauritius with us.
\n
\nPlease let us know if we can be of any assistance,
\n
\nX Company Team`;
const recipient = $w("#input4").value;
sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));
sendEmail(subject, body)
.then(response => console.log(response));
}
I would like my office email to receive another email which contains information from the user inputs.
Hi @shantanukumar847
I’m also trying to send 2 different email on form submission. Can you pls provide the backend javascript files for the above code. It would be much helpful.
Thanks!