How to use Google Sheets for mailings
Here you can find the detailed instructions of how to collect email addresses with the help of a chatbot on Mavibot.ai and send a commercial offer with the script from Google Sheets.
How to create mailings with the help of Google Sheets
function SendMail() {
var ss = SpreadsheetApp.getActiveSpreadsheet()
var sheet = ss.getSheetByName("Sending")
var email = sheet.getRange("a3:a").getValues()
var subj = sheet.getRange("c2").getValue()
var body = sheet.getRange("d2").getValue()
var arr = []
MailApp.sendEmail(email, subj, body)
arr = [[new Date(), email]]
//write sent addresses into Log
ss.getSheetByName("Log").getRange(ss.getSheetByName("Log").getLastRow()+1, 1, 1, 2).setValues(arr)
//clear the Sending sheet
sheet.getRange("a3:a").clearContent()
}How to configure a sheet
How to activate the script

How to configure the chatbot
How to configure a trigger
Other valuable links:
Last updated