Send HTML email from google spreadsheet using a button -


i new stack overflow , looking advice , guidance on google spreadsheet have been working on.

a demo of can found @

https://docs.google.com/spreadsheets/d/1t9wfcg_1_maavpn0l3v58jdd04y1ll3phaeotukq0z4/edit?usp=sharing

basically jist of require following.

a sendemail button in tool bar @ top send html formatted email email on active page in specific colour.

essentially allow me send reminder clients in groups , colour status. have mail each client individually using canned response pretty time consuming.

so far using following script basis, can send email run errors if email fields empty. looking overlook empty fields , continue searching email address. can locate template of active sheet require locate template of sheet , use that. when try adding in html script picks template sends plain text , not sent html.

function sendemails() {   var sheet = spreadsheetapp.getactivesheet();   var startrow = 2;  // first row of data process   var numrows = 100;   // number of rows process   // fetch range of cells a2:b3   var datarange = sheet.getrange(startrow, 1, numrows, 100)   // fetch values each row in range.   var data = datarange.getvalues();   (i in data) {     var row = data[i];     var emailaddress = row[8];  // 8 column     var message = row[15];       // fifteenth column     var subject = "welcome phorest";     mailapp.sendemail(emailaddress, subject, message);   } } 

looking forward speaking can me work out , save me data entry in process.

appreciated.

you can send html-containing email following way:

var email = "some@email.com"; var subject = "hello!"; var html = '<p> favourite fruit? </p> <br>' +            '<select>' +            '<option value="apple">apple</option>' +            '<option value="orange">orange</option>' +            '</select> '; mailapp.sendemail({       to: email,       subject: subject,       htmlbody: html       }); 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -