i found this post that helped me set-up an script that will send a new email to the email provided when a new row is created in a sheet. that works great!
however, i would like for it to include the column header (forgive me if that’s not the right name) before the corresponding row cell-data.
this is my script currently:
function send_email() {
var row = SpreadsheetApp.getActive().getDataRange().getValues().pop();
var message = row.join('n');
var subject = 'test Request for Bid';
var address = '[email protected]';
GmailApp.sendEmail(address, subject, message);
}
this is what the emails look like:
erik
lastname
[email protected]
1234567890
Email
material 1, material 2
77 tons
something and something
something
testing
each line of the email above has a labeled column header i.e. first name, last name, email, phone, etc.)
how would i get the final email to look like this (everything before the “:” is the labeled column header):
first name: erik
last name: lastname
email: [email protected]
phone: 1234567890
preferred contact method: email
materials: material 1, material 2
quantity: 77 tons
cross streets: something and something
city: something
message: testing
thank you for your help!
i do not know where to begin with this unfortunately.
sand4sale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.