COMPLETE Guide to Event Triggers w/ 5 examples

Поделиться
HTML-код
  • Опубликовано: 11 ноя 2024

Комментарии • 22

  • @BootstrappingTools
    @BootstrappingTools  2 года назад

    Link to the code: bootstrappingtools.gumroad.com/l/complete-guide-to-google-apps-script-event-triggers

  • @alameenrahman4420
    @alameenrahman4420 2 года назад +1

    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.

    • @BootstrappingTools
      @BootstrappingTools  Год назад

      Hi Alameen!
      Did you get an error message? Feel free to email support@bootstrapping.tools with the code.

  • @abdullahquhtani4247
    @abdullahquhtani4247 2 года назад +1

    Do you do paid tasks?

    • @BootstrappingTools
      @BootstrappingTools  2 года назад

      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.

  • @DavidTy658
    @DavidTy658 Год назад +1

    Hi Bro, I'm here again. on sample 2, how can I restrict the script to only watch sheet1?

    • @BootstrappingTools
      @BootstrappingTools  Год назад +2

      To do that, wrap the code block in an if statement that compares the target sheet name against the sheet name you want.

    • @DavidTy658
      @DavidTy658 Год назад +2

      @@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

    • @BootstrappingTools
      @BootstrappingTools  Год назад

  • @DavidTy658
    @DavidTy658 2 года назад +1

    Hi, on Example 1 is it possible to trigger the script with google chat instead of slack?

    • @BootstrappingTools
      @BootstrappingTools  2 года назад +1

      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

    • @DavidTy658
      @DavidTy658 2 года назад +1

      Nice. Thank you. I will look into it.

    • @DavidTy658
      @DavidTy658 2 года назад +1

      Thank you for the idea. I manage to make it work.

    • @BootstrappingTools
      @BootstrappingTools  2 года назад

      @@DavidTy658 Amazing! Glad you figured it out :D

  • @DavidTy658
    @DavidTy658 2 года назад +1

    Another question.. on sample 2 can you add an email signature?

    • @BootstrappingTools
      @BootstrappingTools  2 года назад

      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})

    • @DavidTy658
      @DavidTy658 2 года назад

      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

    • @BootstrappingTools
      @BootstrappingTools  2 года назад +1

      ​@@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.

    • @DavidTy658
      @DavidTy658 2 года назад +1

      That did it.. Haha! Again Thank you so much

    • @BootstrappingTools
      @BootstrappingTools  2 года назад

      @@DavidTy658

  • @onyxpraisemedia7020
    @onyxpraisemedia7020 2 года назад +1

    unfortunately, the audio of your videos need to be improved 😮‍💨. its too low...

    • @BootstrappingTools
      @BootstrappingTools  2 года назад

      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!