I have a google-app-maker, and it show some row data table. Every time it's row clicked, it will go to a page. And on that page there is button for sending invoice information. So recipient is static.
Client Name : Name_of_Client
But I can not grab field Name_of_Client into Msg
OnClick Script :
/* var widgets = widget.parent.descendants; */
var to = "[email protected]";
var subject = "Invoice Report";
var msg = "Client Name widget.datasource.item.Client_Name";
/* widgets.EmailStatus.text = 'Sending email...'; */
SendEmail(to, subject, msg);
Client Script :
function clearEmailForm(){
}
function SendEmail(To, Subject, Msg){
var status = "sending";
google.script.run.withSuccessHandler(function(result) {
status.text = 'Email sent...';
clearEmailForm();
})
.SendEmail(To, Subject, Msg);
}
Server Script :
function SendEmail(to, subject, msg){
MailApp.sendEmail(to, subject , msg);
}