Private and secure email by Google at no cost, for business and consumer accounts. Use this app to connect your own developer account credentials.
Go to siteWith the Gmail (Developer App) API on Pipedream, you can automate a variety of email-related tasks, directly manipulating your Gmail account to streamline workflows. From sending emails programmatically to parsing new inbound messages for data extraction, the API allows for deep interaction with your Gmail inbox. Use cases include automating follow-ups, organizing your inbox with filters and labels, and synchronizing important email events with other services to act upon new information instantly.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
gmail_custom_oauth: {
type: "app",
app: "gmail_custom_oauth",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://www.googleapis.com/oauth2/v1/userinfo`,
headers: {
Authorization: `Bearer ${this.gmail_custom_oauth.$auth.oauth_access_token}`,
},
})
},
})
Email Digest Aggregator: Collect and send a daily digest email of all the new messages from a specific label or search query. This could integrate with Slack, sending a summary message to a designated channel every morning.
Customer Support Auto-Responder: Instantly acknowledge incoming support requests by triggering an auto-response email. This workflow can be enhanced by using sentiment analysis via an AI service to categorize the urgency of the request.
Invoice Processing: Detect emails with invoices attached, extract relevant data, and input it into an accounting app like QuickBooks. Upon receipt, the workflow can also send back a confirmation email to the sender.
The Google Developer App in Pipedream can integrate with either a personal Gmail account or a Google workspace email account. Either option involves creating a custom Google App in the Google Cloud Console. This process does not involve any code or special approval by Google. The steps are outlined below:
In order to connect your personal or workspace Gmail account to Pipedream, you'll need to create a custom OAuth app in Google Cloud.
https://mail.google.com/
scope and then click "Update"Now you've created an unlisted Gmail App that you can integrate with Pipedream.
You will need to generate a set of OAuth credentials to connect your new Gmail app to Pipedream properly.
Navigate to the Credentials section on the left side.
Click Create Credentials at the top and select “*OAuth client ID
https://api.pipedream.com/connect/oauth/oa_G7Ain6/callback
At this point, you should have a Gmail App under your Google Project, and a set of OAuth keys.
Now when prompted in Pipedream after trying to connect a Gmail Developer App, copy and paste your OAuth credentials.
Also select the scopes you chose when defining the app. We recommend using https://mail.google.com/
Then click Connect
If you did not publish your Gmail App in the Google Cloud Console, just click Continue to ignore the warning.
Check all of the necessary scopes you'll need for your workflows
Click the final Connect and your custom Gmail app should be integrated into Pipedream!
Google has a 7 day expiration window on refresh tokens for applications with a publishing status of "Testing", so you will need to Publish your application in order to maintain your account connection.
Emit new event for each attachment in a message received. This source is capped at 100 max new messages per run.
Emit new event when an email is received. This source is capped at 100 max new messages per run.
Emit new event for each new email sent. (Maximum of 300 events emited per execution)
Create a draft from your Google Workspace email account
Download an attachment by attachmentId to the /tmp directory. See the docs
Find an email using Google's Search Engine. See the docs
Application disconnects after 7 days
If your developer application disconnects after 7 days, you need to follow the steps above to Publish your custom Gmail app in order to keep your account connected.
Gmail (Developer App) uses OAuth authentication. When you connect your Gmail (Developer App) account, Pipedream will open a popup window where you can sign into Gmail (Developer App) and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Gmail (Developer App) API.
Pipedream requests the following authorization scopes when you connect your account:
do not use
GET
https://accounts.google.com/o/oauth2/auth
?
client_id={{custom_fields.client_id}}
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope=email profile {{custom_fields.space_separated_scopes}}
&
access_type=offline
&
prompt=consent
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
redirect_uri={{oauth.redirect_uri}}
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}