I made a Google script that sends data via mail based on a Google sheet. This sheet has many contributors so I don't know how to make the script to send that mail based in a different account.
Example:
User1 - Admin of the sheet (owner)
User2 - Contributor on the sheet (secondary user)
So I want the button that run my script send the email from the secondary user email, doesn't matters who click the button it will only send the email from the secondary user.
function email(){
var rng = SpreadsheetApp.getActiveSheet().getActiveRange()
var data = rng.getValues()[0];
GmailApp.sendEmail(data[1], data[0], data[2], {htmlBody: '<h1>Hooola</h1>
sdfs'});
}
Here is my JavaScript function, I want to use the sendemail function using that secondary user (which I have access to it)
Thank you for your help.