šŸ“§ Gmail New Email Trigger is Now Available!

Hi Activepiecers,

:tada: Today we are celebrating that we received the CASA Security Certification and got approval to read emails from Google in our app.

You can use the New Email Trigger by using the Gmail Piece. For those who already have a Gmail connection, please reconnect your account.

There is no longer a need to connect to Gmail using IMAP. :grinning:

I would love to hear your use cases and feedback!

Until next time,
Mo. :sparkles:

8 Likes

What a HUGE enhancement for our flows and use cases, I canā€™t believe itā€™s now available! Congrats!!

2 Likes

Reconnecting the account means deleting the connection and connecting again?

Iā€™m afraid that I will have to manually review all the flows that I have with Gmail pieces one by one to make sure nothing got lost in the process.

If Iā€™m not planning to use the new functionality for Gmail, can I leave it as it is ??

Thanks!

No, @Eduardo just click on Reconnect like in this screenshot (but of course for Gmail):

And if you donā€™t want to use this functionality, you donā€™t have to change anything.

2 Likes

@abuaboud
I was planning to use the New Email Triiger.

Any information on this below post?

Creating New Gmail Connection with ClientID and ClientSecret?

@abuaboud - can you confirm the following?

As a non-dev, Iā€™m trying to understand the benefits of this update, so I asked Gemini: ā€œGive me 5 concrete automation examples (so triggers + actions) whatā€™s possible with GMAIL API and not with IMAPā€

Hereā€™s what I got:

Here are 5 concrete automation examples possible with Gmail API and not with specifically within the context of Activepieces (or similar automation platforms):

1. Priority Email Notifications:

  • Trigger: New email arrives in Gmail with the word ā€œUrgentā€ in the subject line AND sent from a specific VIP contact.
  • Action: Send a text message notification to the userā€™s phone through Activepieces, highlighting the sender and subject.

IMAP Limitation: IMAP can only trigger on any new email, not with specific content or sender filters.

2. Automated Task Creation from Emails:

  • Trigger: New email arrives in a specific Gmail label like ā€œProject Xā€ AND contains the phrase ā€œAction Required:ā€.
  • Action: Create a new task in a project management tool (e.g., Asana, Trello) via their API integrations available in Activepieces, extracting the task details from the email body.

IMAP Limitation: IMAP cannot understand content within the email to extract specific information for actions.

3. Smart Email Filtering & Labeling:

  • Trigger: New email arrives from an unknown sender BUT contains keywords related to a specific project.
  • Action: Automatically apply a Gmail label (e.g., ā€œPotential Leadsā€) and move the email to a specific folder using the Gmail API.

IMAP Limitation: IMAP lacks the ability to analyze email content for dynamic filtering and actions.

4. Out-of-Office Reply Based on Content:

  • Trigger: New email arrives while the user has an out-of-office status set in Gmail.
  • Action: If the email contains urgent keywords (e.g., ā€œcritical issue,ā€ ā€œASAPā€), use the Gmail API to send a customized out-of-office reply with emergency contact information. If not, send the standard out-of-office message.

IMAP Limitation: IMAP cannot dynamically adjust out-of-office replies based on email content.

5. Automated Email Forwarding with Modifications:

  • Trigger: Receive an email with attachments in a specific Gmail folder (e.g., ā€œReceiptsā€).
  • Action: Forward the email to an expense management software (e.g., Expensify) using their API integration in Activepieces. Before forwarding, use the Gmail API to add a subject line prefix like ā€œExpense Report:ā€ for better organization.

IMAP Limitation: IMAP cannot modify email content before forwarding.

Is this correct? :slightly_smiling_face:

I have a use case which involves parsing a PDF attachment to an email. Is this possible?

1 Like

Were you able to get help on parsing a PDF attachment to an email?

1 Like

Nope. It doesnā€™t seem to offer the attachment on the next step like it does with the IMAP route.

1 Like

@kishanprmr Can you look into attachments?

2 Likes

@here

Attachments is now added to the body by @kishanprmr

2 Likes

Anyone have a good tutorial on how to save down gmail attachments? Still canā€™t figure it out.

2 Likes

Same! I cant figure out which mapping field needs to be used lolā€¦ #Devless

1 Like

Hello @Jimmy_Martin @Spaz ,

You can find the attachments field in the output of the ā€˜New Emailā€™ trigger. Expand the ā€˜messageā€™ field, and you will find the ā€˜attachmentsā€™ property, which contains the URL for each attachment.

Found it, thank you!

@kishanprmr Thank you for that!

Sorry for the newbie questions. After adding the attachment field and forwarding it out in my flow it seems to not be formatted correctly as it wont open.

Am I doing something wrong?
Screenshot 2024-07-02 105331

1 Like

@Jimmy_Martin In the attachments field for the ā€œNew Emailā€ trigger, it contains data and fileName properties, as shown in the image.

image

When you pass these attachments to the ā€œSend Emailā€ action, make sure you fill the ā€œAttachmentā€ and ā€œAttachment Nameā€ fields, as shown in the image.

This will add the attachment with the correct file name.

image

1 Like

My trigger isnā€™t firing. How can I debug it? Itā€™s a connected Gmail trigger, but there havenā€™t been any new runs since July 17.

Hi @tavva

If you go to the flow and press load sample data again on the trigger, does it work?

Yes. I hit reconnect on the Gmail trigger which has brought it back to life.

This is good for now, but if I donā€™t know when the trigger needs to be reconnected then this will start failing silently.