Gmail API - Receive and Send Emails
FreeSet up an email environment for your users. Complete integrations with all of Gmail APIs.
Setup Instructions
This are step-by-step instructions on how to get the plugin working on any Bubble App. [ml][ol][li indent=0 align=left]Add this plugin to your application.[/li][li indent=0 align=left]Go to https://console.cloud.google.com/ (create an account if you don't have one). Create also a new project for this plugin.[/li][li indent=0 align=left]You will need Gmail API active, and from the credentials tab, add a new Oauth Client ID. [/li][ol data=1][li indent=1 align=left]In Authorized JS Origins add your bubble url (ex: gmail.bubbleapps.io)[/li][li indent=1 align=left]In Authorized redirect URIs add your full bubble url domain with params if needed. This is where you would add at least 2 urls for different versions (ex: https://plugins.datamaticsoftware.com/gmail | https://plugins.datamaticsoftware.com/version-test/gmail)[/li][li indent=1 align=left]NOTE: Remember to test without ?debug_mode=true in your Bubble App[/li][/ol][li indent=0 align=left]Copy Client ID & Client Secret. [/li][li indent=0 align=left]In the Bubble plugin page, place your Client ID & Client Secret.[/li][li indent=0 align=left]Drag-and-drop the Gmail element into your app.[/li][li indent=0 align=left]Add a button with workflow to do 'Oauth Login to Gmail' (action enabled from the Gmail Element).[/li][li indent=0 align=left]Use the parameters from the event (This Gmail email, This Gmail first_name).[/li][/ol][/ml] Check out the step-by-step in this guided [url=https://www.loom.com/share/a5ba8029cbff417ea2f8a761a5c711e0][b]Loom video[/b][/url]
Documentation
[h3][b][u]Data Calls[/u][/b][/h3] [ml][ol][li indent=0 align=left]Gmail - List Emails[/li][li indent=0 align=left]Gmail - Email By ID[/li][/ol][/ml] [h3][b][u]Elements[/u][/b][/h3] [ml][ol][li indent=0 align=left]Google Sign In[/li][/ol][/ml] [h3][b][u]Events[/u][/b][/h3] [ml][ol][li indent=0 align=left]A Google Signin is clicked[/li][/ol][/ml] [h3][b][u]Actions[/u][/b][/h3] [ml][ol][li indent=0 align=left]Gmail Send Email[/li][li indent=0 align=left]Gmail Send Email with Attachment[/li][li indent=0 align=left]Send Email to Trash[/li][li indent=0 align=left]Decode from Base64[/li][li indent=0 align=left]Encode to Base64[/li][/ol][/ml] [h3][b]Gmail - List Emails[/b][/h3] Lists the messages in the user's mailbox.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]maxResults:[/b] Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.[/li][/ul][/ml] [h3]Response body[/h3] If successful, the response body contains data with the following structure:
[quote]JSON representation[/quote][code]{ "messages": [ { object (Message) } ], "nextPageToken": string, "resultSizeEstimate": integer } [/code] Messages[] - object ([color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages?hl=en#Message]Message[/url][/color]) List of messages. Note that each message resource contains only an id and a threadId. Additional message details can be fetched using the Email By ID call.
For more documentation please visit: [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list?hl=en]List Emails API[/url][/color]
[h3][b]Gmail - Email By ID[/b][/h3] Gets the specified message.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]id:[/b] The ID of the message to retrieve. This ID is usually retrieved using messages.list. The ID is also contained in the result when a message is inserted (messages.insert) or imported.[/li][/ul][/ml] [h3]Response body[/h3] If successful, the response body contains an instance of [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages?hl=en#Message]Message[/url][/color]
[h3][b]Google Sing In[/b][/h3] Element with the 'Google Sign In' logo. Choose between two available skins: Light & Dark. Upon click, it will trigger A Google Sign In Is Clicked event on the Workflow tab.
[h3][b]A Google Sign In Is Clicked[/b][/h3] Event that fires upon click of an element Google Sign In. Use it to trigger actions (like Gmail Login) in the Workflow.
[h3][b]Gmail - Send Email[/b][/h3] Sends the specified message to the recipients in the To, Cc, and Bcc headers.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]To:[/b] Define to which email the message will be sent. Accepts multiple email values.[/li][li indent=0 align=left][b]Subject:[/b] Set the subject of the email. Special characters allowed.[/li][li indent=0 align=left][b]Message:[/b] The message that will be sent. Special characters allowed.[/li][/ul][/ml] [h3]Request body[/h3] The request body contains an instance of [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages?hl=en#Message]Message[/url][/color]
[h3]Response body[/h3] If successful, the response body contains an instance of [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages?hl=en#Message]Message[/url][/color]
For more documentation please visit: [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send?hl=en]Send Email API[/url][/color]
[h3][b]Gmail - Send Email with attachments[/b][/h3] Sends the specified message with an attachment to the recipients.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]To[/b]: Define to which email the message will be sent. Accepts multiple email values.[/li][li indent=0 align=left][b]Subject:[/b] Set the subject of the email. Special characters allowed.[/li][li indent=0 align=left][b]Message:[/b] The message that will be sent. Special characters allowed.[/li][li indent=0 align=left][b]filename:[/b] Set the correct name of the file that will be attached. Including extension (e.g file.pdf). An incorrect name will cause the file to corrupt.[/li][li indent=0 align=left][b]data:[/b] The file that will be sent. Only accepts a string encoded in base64. Use Bubble's function :encoded in base64 to correctly send a file.[/li][/ul][/ml] [h3]Request body[/h3] The request body contains an instance of [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages?hl=en#Message]Message[/url][/color]
[h3]Response body[/h3] If successful, the response body contains an instance of [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages?hl=en#Message]Message[/url][/color]
For more documentation please visit: [url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send?hl=en]Send Email API[/url]
[h3][b]Gmail - Send Email to Trash[/b][/h3] Moves the specified message to the trash.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]id:[/b] The ID of the message to Trash.[/li][/ul][/ml] [h3]Response body[/h3] If successful, the response body contains an instance of [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages#Message]Message[/url][/color]
For more documentation please visit: [color=rgb(0, 102, 204)][url=https://developers.google.com/gmail/api/reference/rest/v1/users.messages/trash?hl=en]Trash API[/url][/color]
[h3][b]Decode from Base64[/b][/h3] Email body is received encoded in base64. To correctly display the message body, use this Action.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]input:[/b] Data to be decoded. Only accepts a string encoded in base64.[/li][/ul][/ml] [h3]Response body[/h3] [ml][ul][li indent=0 align=left][b]decoded:[/b] Data decoded. Use this to display what the message contains.[/li][/ul][/ml] [h3][b]Encode to Base64[/b][/h3] Encode a string into Base64. The subject needs to be encoded in base64 to allow special characters (like emojis, apostrophes, etc). Don't use this in the message, message is automatically converted.
[h3]Path parameters[/h3] [ml][ul][li indent=0 align=left][b]input:[/b] string to be encoded. Only accepts a valid string.[/li][/ul][/ml] [h3]Response body[/h3] [ml][ul][li indent=0 align=left][b]encoded:[/b] string in base64 encoding. Use this data in the subject parameter when sending a message.[/li][/ul][/ml]