Gmail offers private and secure email by Google at no cost, for business and consumer accounts.
Go to siteBy connecting your personal Gmail account to Pipedream, you'll be able to incorporate email into whatever you're building with any of the thousands of apps that are available on Pipedream.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
gmail: {
type: "app",
app: "gmail",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://www.googleapis.com/oauth2/v1/userinfo`,
headers: {
Authorization: `Bearer ${this.gmail.$auth.oauth_access_token}`,
},
})
},
})
To connect your Gmail account to Pipedream, just accept the prompt when connecting your Gmail account.
Google requires integration platforms such as Pipedream, to restrict the scopes users can enable for Gmail, in order to regulate the ability of users to build workflows and connect applications.
Currently, the Gmail app on Pipedream is limited to only sending emails on behalf of your Gmail email address associated with this app.
However, the Gmail Developer App is unrestricted because you have the ability to control the scopes through creating your own Google Cloud Project.
Because you can define your own scopes, you can read and write emails with your own Google Cloud Project. To learn how to create and authenticate a Gmail Developer App read our setup guide.
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 matching the search criteria is received. This source is capped at 100 max new messages per run.
Emit new event for each new email sent. (Maximum of 100 events emited per execution)
Create a draft from your Google Workspace email account. See the documentation
Download an attachment by attachmentId to the /tmp directory. See the documentation
Gmail uses OAuth authentication. When you connect your Gmail account, Pipedream will open a popup window where you can sign into Gmail 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 API.
Pipedream requests the following authorization scopes when you connect your account:
email
profile
openid
https://www.googleapis.com/auth/gmail.labels
https://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
https://www.googleapis.com/auth/gmail.settings.basic
GET
https://accounts.google.com/o/oauth2/auth
?
client_id={{oauth.client_id}}
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope={{oauth.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={{oauth.client_id}}
&
client_secret={{oauth.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={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}