Skip to main content
The Gmail Handler enables seamless interaction with the Gmail API for sending, reading, and managing emails. It handles authentication using OAuth 2.0, and provides methods to fetch user profiles, read emails with attachments, send new emails, and create drafts. It is designed to integrate Gmail into automation workflows securely and efficiently.

Example

To create the GmailHandler, initialize it with credentials JSON for OAuth:
Get User Profile:
Retrieve Gmail profile information for the authenticated user.
Read Emails:
Fetches the latest emails, including sender, receiver, subject, body, and attachments.
Send Email:
Send an email via Gmail.
Create Draft Email:
Create a draft email that can be sent later.