Apps Script - How to Send an Email from a Spreadsheet in Google Sheets

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

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

  • @Blessed24724
    @Blessed24724 4 месяца назад +1

    Hi Eamonn! I hope you're doing great! HUGE THANK YOU for your videos! I went ahead and copied this app script, everything works perfectly now the only thing is my emails are going to people's spam box. If there any way I can fix this? Thank you in advance!

    • @EamonnCottrell
      @EamonnCottrell  4 месяца назад

      Hey! Glad it worked...I have not run into deliverability issues in my testing. Since it's being sent from your gmail address, nothing that we're doing here should flag that for spam any differently than your regular emails. I have had some of my own gmails get flagged by people I email regularly, though, so I think this in general is sometimes an issue for whatever reason

  • @NoahJashinski
    @NoahJashinski 3 месяца назад +1

    Hey There ! Thanks so much for the video. SUPER helpful. I was curious - is there a way to set it up so you can send additional columns? More or less have what would be the subject for instance, be divided amongst numerous columns, but still function the same. Would that involve changing the numbers, as in adding e4, e5, etc while changing the send to whatever the last one is (i.e. e7)? Thanks !

    • @EamonnCottrell
      @EamonnCottrell  3 месяца назад +1

      Hey there! yes, you can do this a couple ways. The easiest (imo) would be to have those numerous columns combine into one in the spreadsheet itself.
      So if you've got three cells with three paragraphs in the spreadsheet somewhere, simply concatenate them together into the one cell (column C in my example).
      For instance, =H2+I2+J2, would combine those three cells into one.
      The other way would be to do it in the code itself, but generally, this is more tedious.
      Shoot me an email if you want to share your sheet and ask me about specifics. (my full name at gmail)

    • @NoahJashinski
      @NoahJashinski 3 месяца назад

      @@EamonnCottrell Sent ! 🙏

  • @ShakedMoyal
    @ShakedMoyal Месяц назад +1

    Nice vid. I'd really like to know how to attach a pdf file into the email from google drive . thanks

    • @EamonnCottrell
      @EamonnCottrell  Месяц назад

      Great idea for the advanced options. I haven't done an advanced video yet, but here's a link to the docs of what you'd have to add. It's not much. You can find the id for the pdf in the url when you open it up. developers.google.com/apps-script/reference/gmail/gmail-app#sendemailrecipient,-subject,-body,-options

    • @ShakedMoyal
      @ShakedMoyal Месяц назад

      @@EamonnCottrell Thanks. As I've seen in the video , every "e" represents a column, right? so If I add e[3] It should enable the Options column, but it doesn't. what am I missing here?🤔 . I'm very new to app script so I guess I will wait for your video :)

    • @ShakedMoyal
      @ShakedMoyal Месяц назад +1

      I've made it ! yay!. just need to add after e[2], {attachments: [file.getAs(MimeType.PDF)]} and attach the drive file with var.

    • @EamonnCottrell
      @EamonnCottrell  Месяц назад

      @@ShakedMoyal Excellent!

  • @ilsefrickx3372
    @ilsefrickx3372 6 месяцев назад +2

    I would like to see the ‘advanced’ version 😊. Thank you!

  • @benjaminkoester9801
    @benjaminkoester9801 Месяц назад +1

    Is there a way to get the script to not run on a row and email that has already been sent, other than unchecking the box?

    • @EamonnCottrell
      @EamonnCottrell  Месяц назад

      You could reverse what I did here so that checking it signifies that it's been sent. but you need to bake in a condition for it to check.

  • @StefanRoderer
    @StefanRoderer 3 месяца назад +1

    very nice and straight forward vid, thanks!
    is there a possibility to get the signature from gmail as well?
    const signature = Gmail.Users.Settings.SendAs.list('me').sendAs.find(account => account.isDefault).signature
    but i'm a beginner and don't know how to combine this with the values of e[2]
    thanks in advance for your support!

    • @EamonnCottrell
      @EamonnCottrell  3 месяца назад

      Great question - I just learned something new figuring it out. Two things: you need to add the Gmail API service in the Apps Scripts menu first. Just click Add a service in the left sidebar after you open your apps script file and then scroll down to click Gmail.
      Then, you do have to arrange things a little different for the signature to work because it brings it in as html. Check out my sample version at the bottom of the original sheet's apps script file. I added a working function withSignatureLine() at the bottom.

  • @Levram-w3r
    @Levram-w3r 3 месяца назад +1

    Exception: Invalid email: Recepient
    I did everything like in the video and I get this prompt when I click the send email button on the ribbon, any idea why?

    • @EamonnCottrell
      @EamonnCottrell  3 месяца назад

      Hmm, not sure. Can you share your sheet with me and I can check it out. (my full name at gmail)

  • @kimberlymayalall744
    @kimberlymayalall744 5 месяцев назад +1

    What about if you have a lot of receipts? and can you BCC?

    • @EamonnCottrell
      @EamonnCottrell  5 месяцев назад

      Yes! You can add more options. I added the bcc option to show you an example in the apps script on line 6 of the demo sheet.

  • @LucianaBrakha
    @LucianaBrakha 2 месяца назад

    I keep getting Code:3 and Code:5 errors, what does that mean? Struggling to correct it

    • @EamonnCottrell
      @EamonnCottrell  2 месяца назад

      Can you share your sheet with me so I can check out what's going on? (my full name at gmail)