Very useful video - thanks. Am trying to replicate example 1 and while the execution works (the log shows the correct info being pulled through) - the Slack part does not work at all since it does not send me my target message. Happy to send you my code if you wish to troubleshoot, but essentially looks like the same as the Slack function with the api_key replaced.
Hi! Yes, it's totally possible to do that. You would need to connect to the Google Chat API to do that. Here's some of google's documentation on it: developers.google.com/chat/api/reference/rest/v1/spaces.messages/create
Yeah, you can totally add a signature. There's actually two ways to go about it. One way is to create the signature in code and then pass it through as html into the sendEmail call. The other method is to activate the Gmail API service (under the "Services" section of the editor) and then pull the signature associated to your account. Here's some sample code that will pull your default account's signature (this might not work if you're signed into multiple accounts and the one you want isn't set as the default) let signature = Gmail.Users.Settings.SendAs.list("me").sendAs.filter((account) => account.isDefault)[0].signature From there, just add it to the sendEmail call as html. Like so: GmailApp.sendEmail(recipient, subject, body, {htmlBody: body})
I tried creating a HTML file (signature) on the app script. and tried GmailApp.sendEmail(recipient, subject, body, {htmlBody: template) but the body disappears if I add {htmlBody: template}) it only displays the signature. Im kinda stuck at this point. lol
@@DavidTy658 you're almost there! Is your signature assigned to the "template" variable? If so, you actually want to combine the body with the signature. Try converting the body to an HTML format and then append the signature to the end of that.
Thanks for the note - the mic positioning got a bit better in the second half of the examples. Future videos will have the new settings so those should have better audio!
Link to the code: bootstrappingtools.gumroad.com/l/complete-guide-to-google-apps-script-event-triggers
Very useful video - thanks. Am trying to replicate example 1 and while the execution works (the log shows the correct info being pulled through) - the Slack part does not work at all since it does not send me my target message.
Happy to send you my code if you wish to troubleshoot, but essentially looks like the same as the Slack function with the api_key replaced.
Hi Alameen!
Did you get an error message? Feel free to email support@bootstrapping.tools with the code.
Do you do paid tasks?
Depends on the project size, your timeline, and also my availability. Send an email to social@bootstrapping.tools and we can figure out the details.
Hi Bro, I'm here again. on sample 2, how can I restrict the script to only watch sheet1?
To do that, wrap the code block in an if statement that compares the target sheet name against the sheet name you want.
@@BootstrappingTools it worked. why didn't I think of that. lol
I added this line of code
var sheet = e.source.getActiveSheet();
if (sheet.getName() == "Sheet1") {
my code is here
}
thanks. ur the best
Hi, on Example 1 is it possible to trigger the script with google chat instead of slack?
Hi!
Yes, it's totally possible to do that. You would need to connect to the Google Chat API to do that. Here's some of google's documentation on it: developers.google.com/chat/api/reference/rest/v1/spaces.messages/create
Nice. Thank you. I will look into it.
Thank you for the idea. I manage to make it work.
@@DavidTy658 Amazing! Glad you figured it out :D
Another question.. on sample 2 can you add an email signature?
Yeah, you can totally add a signature. There's actually two ways to go about it.
One way is to create the signature in code and then pass it through as html into the sendEmail call.
The other method is to activate the Gmail API service (under the "Services" section of the editor) and then pull the signature associated to your account. Here's some sample code that will pull your default account's signature (this might not work if you're signed into multiple accounts and the one you want isn't set as the default)
let signature = Gmail.Users.Settings.SendAs.list("me").sendAs.filter((account) => account.isDefault)[0].signature
From there, just add it to the sendEmail call as html. Like so:
GmailApp.sendEmail(recipient, subject, body, {htmlBody: body})
I tried creating a HTML file (signature) on the app script. and tried GmailApp.sendEmail(recipient, subject, body, {htmlBody: template) but the body disappears if I add {htmlBody: template}) it only displays the signature. Im kinda stuck at this point. lol
@@DavidTy658 you're almost there!
Is your signature assigned to the "template" variable? If so, you actually want to combine the body with the signature. Try converting the body to an HTML format and then append the signature to the end of that.
That did it.. Haha! Again Thank you so much
@@DavidTy658
unfortunately, the audio of your videos need to be improved 😮💨. its too low...
Thanks for the note - the mic positioning got a bit better in the second half of the examples. Future videos will have the new settings so those should have better audio!