Google Script Email Autoresponse

Using Google Script for your Email autoresponders

Google Autoresponder Script

When you create a form the responses will be stored in Google Sheets which acts as the database. Go to the Sheet by clicking one the form responses. When you are in the sheet go to the tools menu and select "script editor".

Using Google Script Editor

You need to create a new project. Call it "Google Form Autoresponder" or whatever you want. Doesn't really matter. Now you need to copy and paste the following code. Edit the code according to your own variables.

/* Send Confirmation Email with Google Forms */
function Initialize() {

var triggers = ScriptApp.getProjectTriggers();

for (var i in triggers) {
ScriptApp.deleteTrigger(triggers[i]);
}

ScriptApp.newTrigger("SendConfirmationMail")
.forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
.onFormSubmit()
.create();

}

function SendConfirmationMail(e) {

try {

var ss, cc, sendername, subject, columns;
var message, value, textbody, sender;

// Enable variables such client name and subject to be placed in body and subject.
// This will depend on your form.

var clientname = e.namedValues["Name"].toString();
var tutorsubject = e.namedValues["Subject/s"].toString();

// This is your email address and you will be in the CC
cc = "yourname@yourdomain.com";

// This will show up as the sender's name
sendername = "Your Name";

// Optional but change the following variable
// to have a custom subject for Google Docs emails
// to have a variable in subject you would use the following code
// subject = tutorsubject + " tuition enquiry";
subject = "Tuition Enquiry";

// This is the body of the auto-reply
message = "Hi " + clientname + ",<br><br>Further to your enquiry about our tuition services. I have allocated you a tutor coordinator who will be in touch shortly. <br><br>Information about our rates can be found <a href=http://google.com>here</a>. <br> <br> If you have any queries please let me know. <br><br>Kind Regards, <br>Your Name<br>Title<br>www.google.com <br>Phone Number<br><br>";

// This code places the respondents details in the email in case they want to check their submission.
ss = SpreadsheetApp.getActiveSheet();
columns = ss.getRange(1, 1, 1, ss.getLastColumn()).getValues()[0];

// This is the submitter's email address
// Make sure you have field called Email Address in the Google Form
sender = e.namedValues["Email Address"].toString();

// Only include form values that are not blank
for (var keys in columns) {
var key = columns[keys];
var val = e.namedValues[key] ? e.namedValues[key].toString() : "";
if (val !== "") {
message += key + ' :: ' + val + "<br />";
}
}

textbody = message.replace("<br>", "\n");

GmailApp.sendEmail(sender, subject, textbody, {
cc: cc,
name: sendername,
htmlBody: message
});

} catch (e) {
Logger.log(e.toString());
}
// FOR ASSISTANCE WITH GOOGLE SCRIPT AND OTHER GOOGLE QUERIES GO TO GOOGLENESS.COM
}

Once you've copied the code. Click save. From the program drop down menu click "start". Now click "run" which will run the start program. Google will ask you to authorize the program. You need to give permission for the program as the autoresponder will be sent from your gmail account.

You can make changes to the autoresponder as you wish. For more help you can contact me.

Gmail Tip

Make sure your autoresponder has no more than three snippets of information. People rarely read further than this.

Gmail Accounts and Import

Gmail Tip

Use Google Docs for autoresponders to ensure delivery. Why? Because Gmail rarely blocks mails from their own servers.

Gmail Accounts and Import
Create Gmail Filter
Advantages using Google Drive

Twelve advantages of using Google Drive

Google Drive

Google Drive provides a platform for you to manage your documents and files. It  integrates all the other Google apps to help organize your personal and business affairs. Here are some of the advantages of the resource.

 

1. Free

The best thing about Google Drive is it is free. You get 15 GB of storage free which is for Gmail and Drive.

2. Multiple Devices

Google Drive can be accessed on any device. It is responsive and can be used on your mobile, tablet or desktop.

3. Preview

You can preview your files via Drive on your browser. You don't need to install the program in which the file was created.

4. Collaborating

When you share your Google documents via Drive you can allow recipients to edit. Users can collaborate with multiple users working on the same document simultaneously.

5. File Organization

You can drag and drop files or folders intuitively. This allows you to organize your Drive whether you are in your web browser or on your Device's internal hard-drive.

6. Security

Google Drive encrypts your data to ensure that it is secure. Your data is backed up on multiple servers in case of emergency. You can individually decide which files to share.

7. Search

As expected Google Drive makes it very easy to find your documents. You simply type in a keyword search and it lists the files containing that word. You can also search by date and document size.

8. Syncing

Google Drive automatically syncs your files and folders. When you update files on any of your devices the changes will be updated. This works in the background so you don't need to do anything yourself.

9. Sharing

You can share any of your Google documents via Drive. Simply type in the email address of the person you would like to Share it with. You can also send a clickable link to the document or post publicly.

10. Remote access

You can access your Google Drive from anywhere in the world on any device. Data is stored on Google servers so all your need is an internet connection and your login details.

11. OCR

Documents scanned into Google Drive can be searched using optical characteristics. So old archived documents (non-text files) can still be indexed.

12. PC Integration

Google Drive creates a folder on your PC which is a mirror of the online Drive. Syncing occurs while you're online. The folder can be accessed even while Offline.