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], [pixel_tracking_id])

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 custom styling to email body

With our new rich text editor, you can now generate style the email body text without manually writing HTML and CSS.

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.

Email Tracking

You can use tracking pixels to track the open status of your outbound emails. Here is a demo showcasing this functionality:

You can aggregate the values of these TRUE and FALSE using the COUNTIF and COUNTA formulae.

=ROUND(COUNTIF(E:E,TRUE)/(COUNTA(E:E)-1),3)

Let's break down this formula:

  • COUNTIF(E:E, TRUE): This formula counts the number of TRUE entries in column E.
  • COUNTA(E:E)-1: This formula counts the number of non-blank entries in column E. Don't forget to subtract by 1 to ignore the header cell.
  • ROUND(..., 3): This rounds the decimal places of the cell.