function doGet(e) {
return HtmlService.createHtmlOutput("Request received");
}
function doPost(e) {
const sheetId = "1mtcnW8qUKz6mSRaVfIuajtyWbwlFf4s3PjT0Jh3VbNk"; // Replace with your actual sheet ID
const sheetName = "Sheet1"; // Replace with your actual sheet name
try {
const ss = SpreadsheetApp.openById(sheetId);
const sheet = ss.getSheetByName(sheetName);
const params = e.parameter;
// Append the form data to the sheet
sheet.appendRow([params.name, params.email, params.phone]);
// Log to check if appendRow is successful
Logger.log("Data appended: " + JSON.stringify(params));
// Call the function to send email from the last row
sendEmailFromLastRow();
// Log to check if sendEmailFromLastRow is called
Logger.log("sendEmailFromLastRow function called");
// Return a simple HTML response indicating success
} catch (error) {
Logger.log("Error in doPost: " + error.toString());
}
}
function dryRun() {
var params = {
parameter : {
name: "ranvijay",
email: "[email protected]",`your text`
phone: "99999"
}}
doPost(params)
}
This is my code in appscript. when i run manually this code works but it does not send email when someone hit the submit button in my framer website contact us page.
kindly suggest if there is any error
New contributor
Ranvijay Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.