Well many of us want to send especially bloggers sometimes want to send automated replies to user 's ..but as usual, not everyone is a code geek or lovers ... so this is a small guide to How to use Google form with Google sheet to make an automated reply link....so follow the steps accordingly.
STEP 1: GOTO google Forms ... and create a form ...
in my case I just take users email id and how do they get to my site.
1. GOTO https://docs.google.com/forms?usp=mkt_forms
2. login with your account. now choose blank form.
3. in Form title write your forms name, for example, let say my form.
4. in Form description write the description let say
A simple form ...
5. now go to setting and in general tab, check collect email address.
and click on save
6. (optional) you can also ask some basic question
7. now goto responses tab
now click on create new spreadsheet button. (that green icon ..)
in select response, destination chooses to create a new spreadsheet and give it a name and click create.
-----------------------------------------------------PART 2 ---------------------------------------------------
now goto google sheet . login and open the spredsheet that was autocreated by our forms.
1. when the spreadsheet is opened it will look like this.
now goto tools>Script editor ....
2.now a IDE window will open ... erase all its content and copy the code below
----------------------copy from below[do not copy this line]----------------
var EMAIL_SENT = "EMAIL_SENT";
function sendEmails2() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2;
var numRows = 2;
var dataRange = sheet.getRange(startRow, 2, numRows, 4)
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (var i = 0; i < data.length; ++i) {
var row = data[i];
var emailAddress = row[0];
var message = " REPLACE WITH YOUR MESSAGE"; // Second column
var emailSent = row[3]; // fourth
if (emailSent != EMAIL_SENT) { // Prevents sending duplicates
var subject = "replace with your subject";
MailApp.sendEmail(emailAddress,
subject,
message);
sheet.getRange(startRow + i, 4).setValue(EMAIL_SENT);
// Make sure the cell is updated right away in case the script is interrupted
SpreadsheetApp.flush();
}
}
}
function onEdit(){
var sheet = SpreadsheetApp.getActiveSheet();
var editedCell = sheet.getActiveCell();
var sheet = SpreadsheetApp.getActiveSheet();
var editedCell = sheet.getActiveCell();
var columnToSortBy = 1;
var tableRange = "A2:C99"; // What to sort.
{
var range = sheet.getRange(tableRange);
range.sort( { column : columnToSortBy, ascending: false } );
}
}
----------------------copy end [do not copy this line]----------------
3. Now save your code.it will ask you for your project name ..
give it any name and save.
4. now click on that timer icon ( current projects trigger)
5. click on no triggers set up ,click here to set one now
6. in first combo select onEdit.
the second combo choose from spreadsheet and in last combo select on form submit.
7. now click on add new trigger and in first combo box select sendemails2 and in the second combo choose from spreadsheet and in last combo select on form submit..
-------as above -----------------
8. Click on save.
9. now it will ask for review ...
click on review permission and log in with your email id.
and click on allow
10..NOW CLOSE EVERYTHING AND NOW YOU JUST NEED TO ADD THAT GOOGLE FORM TO YOUR POST.
just like here to do so ..open your form and click on the send button
and get a shareable link ... like this ..https://goo.gl/forms/TfGr30AMvs8uF4LI2
else you can also embed that form using the html code of your form ..here i have one for you .. fill the form below and check whether its working or not...
STEP 1: GOTO google Forms ... and create a form ...
in my case I just take users email id and how do they get to my site.
1. GOTO https://docs.google.com/forms?usp=mkt_forms
2. login with your account. now choose blank form.
3. in Form title write your forms name, for example, let say my form.
4. in Form description write the description let say
A simple form ...
5. now go to setting and in general tab, check collect email address.
and click on save
6. (optional) you can also ask some basic question
7. now goto responses tab
now click on create new spreadsheet button. (that green icon ..)
in select response, destination chooses to create a new spreadsheet and give it a name and click create.
-----------------------------------------------------PART 2 ---------------------------------------------------
now goto google sheet . login and open the spredsheet that was autocreated by our forms.
1. when the spreadsheet is opened it will look like this.
now goto tools>Script editor ....
2.now a IDE window will open ... erase all its content and copy the code below
----------------------copy from below[do not copy this line]----------------
var EMAIL_SENT = "EMAIL_SENT";
function sendEmails2() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2;
var numRows = 2;
var dataRange = sheet.getRange(startRow, 2, numRows, 4)
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (var i = 0; i < data.length; ++i) {
var row = data[i];
var emailAddress = row[0];
var message = " REPLACE WITH YOUR MESSAGE"; // Second column
var emailSent = row[3]; // fourth
if (emailSent != EMAIL_SENT) { // Prevents sending duplicates
var subject = "replace with your subject";
MailApp.sendEmail(emailAddress,
subject,
message);
sheet.getRange(startRow + i, 4).setValue(EMAIL_SENT);
// Make sure the cell is updated right away in case the script is interrupted
SpreadsheetApp.flush();
}
}
}
function onEdit(){
var sheet = SpreadsheetApp.getActiveSheet();
var editedCell = sheet.getActiveCell();
var sheet = SpreadsheetApp.getActiveSheet();
var editedCell = sheet.getActiveCell();
var columnToSortBy = 1;
var tableRange = "A2:C99"; // What to sort.
{
var range = sheet.getRange(tableRange);
range.sort( { column : columnToSortBy, ascending: false } );
}
}
----------------------copy end [do not copy this line]----------------
3. Now save your code.it will ask you for your project name ..
give it any name and save.
4. now click on that timer icon ( current projects trigger)
5. click on no triggers set up ,click here to set one now
6. in first combo select onEdit.
the second combo choose from spreadsheet and in last combo select on form submit.
7. now click on add new trigger and in first combo box select sendemails2 and in the second combo choose from spreadsheet and in last combo select on form submit..
-------as above -----------------
8. Click on save.
9. now it will ask for review ...
click on review permission and log in with your email id.
and click on allow
10..NOW CLOSE EVERYTHING AND NOW YOU JUST NEED TO ADD THAT GOOGLE FORM TO YOUR POST.
just like here to do so ..open your form and click on the send button
and get a shareable link ... like this ..https://goo.gl/forms/TfGr30AMvs8uF4LI2
else you can also embed that form using the html code of your form ..here i have one for you .. fill the form below and check whether its working or not...
Google Sheet/Google Form Script To Send Automated Email To Users >>>>> Download Now
ReplyDelete>>>>> Download Full
Google Sheet/Google Form Script To Send Automated Email To Users >>>>> Download LINK
>>>>> Download Now
Google Sheet/Google Form Script To Send Automated Email To Users >>>>> Download Full
>>>>> Download LINK rb