Gmail
12 min
learn how to connect engini to gmail using engini’s gmail activities, you can check for new sent emails, send emails and include attachments seamlessly to get started with the gmail app, create an free account at google com https //accounts google com/lifecycle/steps/signup/name?continue=https //myaccount google com/?utm source%3dogb%26utm medium%3dapp\&dsh=s1124731923 1701622503736389\&ec=galawae\&flowentry=signup\&flowname=glifwebsignin\&hl=iw\&service=accountsettings\&theme=glif\&tl=ahnytiqqcow4phnaw961kpenhpromr2l5dc813x8r5ekxse8efa97ajs5hv5zkgy or use your organizational google mailbox getting started with gmail prerequisites an gmail account add a connection to gmail in engini enter your engini account at https //app engini io https //app engini io/ navigate to connections page by clicking on the connections on the left sidebar or by clicking here https //app engini io/connections click on the "new integration" option located at the top bar choose gmail option from the available applications enter the following details in the “new integration” form and press save note there are two different authentication methods available, and the required fields differ depending on the option you choose please follow the relevant instructions based on your selected method oauth2 this method uses a predefined authentication flow you don’t need to provide a client id or client secret, you simply sign in using your account connection name choose a unique identifier for the connection within engini authentication method select oauth2 click on the “sign in with google” button fields automatically populated post connecting to a google account include email used as the primary email address associated with the account display name employed when utilizing the email sending activity, enabling customized sender names access token a token for authorization to access google services refresh token a token used to obtain a new access token when the current one expires save settings click on the save settings button to save the connection custom oauth2 this method requires you to configure your own oauth2 credentials you must provide both a valid client id and client secret obtained from your google cloud console project connection name choose a unique identifier for the connection within engini authentication method select custom oauth2 when connecting to google services using a custom oauth client to learn more about this authentication, enter here https //help engini ai/connect to google services using a custom oauth client client id enter the client id from the oauth 2 0 credentials in the google cloud project we created client secret enter the client secret from the same set of oauth 2 0 credentials in the google cloud project sign in with google – click sign in with google and log in with the google account used to create the project in google cloud this ensures access to the correct oauth credentials and permissions access token & refresh token automatically populated post connecting to a your google account save settings click on the save button to save the connection trigger check for new emails the trigger monitors the mailbox, listening for new emails sent to the connected mailbox at scheduled intervals as defined starting (utc) select the start date and time for the scheduled trigger recur every choose the time interval for triggering and checking emails the minimum time interval is 15 minutes add time frame you can specify a time frame during which the trigger will operate click on “add time frame” button select a specific time frame to activate the trigger for example, every 15 minutes from 8 am to 5 pm add filter click add filter to define conditions that narrow down the data list and return only the relevant items to learn more about using filters, click here https //help engini ai/workflow editor#add filters email’s properties let’s understand what the properties received are body – the body property contains the entire message body in formal html format cc – the “cc” contains a string with all the emails included in the cc (carbon copy) field the emails are separated by commas within the string cc emails\[] the email addresses that were included in the cc fields of the email from – the ‘from’ property contains the email address from which the email to this mailbox was sent from email the actual sender's emaiil address labelids\[] – this property holds the labels associated with the email, providing categorization or classification details message id – this property contains the unique identifier for the email for use in subsequent actions received datetime – the ‘received date time’ received is in the israeli time zone (utc + 3) and includes both the date and time size estimate – it indicates an estimated size or storage space occupied by the email content snippet – it presents a brief excerpt or summary of the email content for quick insight or preview subject – it contains the email subject threadid – this property carries the identifier linking the email to its respective email thread or conversation to – the ‘to’ property contains a string with all the email addresses to which the email received by this mailbox was sent if the email was only sent to this mailbox, only the email address of this mailbox will appear if the email was sent to additional email addresses, the email addresses will be separated by commas in the string to emails\[] the actual recipient email addresses listed in the to field, as a clean list actions sent email send email when using your gmail account to enter the recipient’s email address click on the empty field, and a tooltip will appear, displaying the email fields you can use from the tooltip, select the recipient’s email address, or you can use a static value when using strings, be sure to enclose them in single quotes (‘) subject fill in the email subject populate the field with static value – number / string when using strings, you need to surround them with single quotes (‘) you can also use property value from a previous activity (using the tooltip that opens when clicking on the field) body the body of an email is the main content of the message you are sending it is the section where you write the text of your message and convey the purpose or intention of your email click on the empty field next to the label “body ” a window will open where you can enter the email body to learn more about managing activity data, click here https //help engini ai/workflow editor#add fields add field click add field to add and populate additional fields for the selected activity to learn more about managing activity data, click here https //help engini ai/workflow editor#add fields initialize attachment array to create multiple files that will be sent in the email, you need to initialize an array for the files choose this action to initialize the array and give it a name append to attachments array append files to attachments array variable choose the array in which you want to include the files from the drop down file name specify the file name content choose the content that the file will contain please note that the content should be in base64 format note to use this action, you first need to initialize an array