SENDGMAIL formula

Lido's =SENDGMAIL() formula lets you send emails from your Gmail account directly from Lido.

=SENDGMAIL(<your GMAIL credential>, recipient, subject, body, [status_cell],[cc], [bcc], [attachments], [sender])

Authenticating your email sender account

You'll be prompted to oAuth into your Gmail account the first time that you run a SENDGMAIL action in Lido from a new email account.

Using multiple sender emails

You can send emails from multiple accounts in the same Lido file / account. Simply change the sender argument in your SENDGMAIL formula, then oAuth into the new account. You can send emails from any email account that you've authenticated.

Using email aliases (sending from a different email address then your primary Gmail)

The last argument of the SENDGMAIL function is an optional sender argument. You can use this to send an email from a registered alias. It looks like SENDGMAIL(<credential>, "[email protected]", "subject", "body", , , , , "[email protected]"). If you haven't added an alias yet, you can follow this guide to do so.

🚧

Don't forget the custom From field step

Visit this link for more information on From field setup

Sending emails to multiple recipients

You can send emails to multiple recipients by passing your recipient list as an array in the second argument of your SENDGMAIL formula.

=SENDGMAIL(<your GMAIL credential>, ARRAY(email1, email2, email3), subject, body)

Make sure that each email is passed through as a string. Valid syntaxes include:

ARRAY(A1, A2, A3) if your recipient emails are in different spreadsheet cells.

Alternatively, you can do ARRAY("email1", "email2", "email3")

Attachments

Attachments need to be passed through as statically hosted URLs. The URL needs to be the direct download link for a file, and not a preview or share link. We only support attachments less than 25MB at this time.

Here are instructions for how to find this link from common places.

From Google Drive

You can use this direct link generator for files that have been uploaded directly to Google Drive:

https://sites.google.com/site/gdocs2direct/

🚧

This link generator does NOT work for Google docs / sheets / slides.

If you want to send a Google doc / sheet / slide, we recommend putting the share link directly in the email body instead.

From Dropbox

  1. Find the normal sharing link from Dropbox. Go to Dropbox.com, find your file, and click the Copy link button that appears when you hover over it. Or, on your desktop, right-click on the file, and select Copy Dropbox Link.
    1. You should have a link like: https://www.dropbox.com/s/hriinb9w3a2107m/iPad%20intro.pdf
  2. Replace the www.dropbox.com with dl.dropboxusercontent.com, which will give you a link like: https://dl.dropboxusercontent.com/s/hriinb9w3a2107m/iPad%20intro.pdf
  3. Pass the link from step 2 into your SENDGMAIL formula

Sending multiple attachments

You can send multiple attachments using two methods:

=SENDGMAIL(<your GMAIL credential>, recipient, subject, body,[status_cell],[cc], [bcc], array(url1, url2))

OR

=SENDGMAIL(<your GMAIL credential>, recipient, subject, body, [status_cell],[cc], [bcc], "url1, url2, url3")

Adding HTML and CSS formats

You can pass HTML through the body argument of your SENDGMAIL formula, as long as everything is wrapped in quotes.

CSS styles are supported as well but must be passed through inline.

Success / Error status

It is important to be confident of the results of any SENDMAIL actions that have been run and see any errors that occur. To store the status of SENDGMAIL in a cell, include a cell reference in the status_cell argument :

=SENDGMAIL(<your GMAIL credential>,"[email protected]","subject","body", A1)

An example of a successful SENDGMAIL

If you right click on the SENDGMAIL action, the action will run, and the result will populate Cell B5.

An example of a failed SENDGMAIL action with the error message

This example tries to use an outgoing email account that is not authenticated.