// This assembly is included in the following assemblies:
// Upstream: as_connecting-to-google.adoc
// Downstream: connecting-fuse-online-to-applications-and-services/as_connecting-to-google.adoc

[id='connecting-to-gmail_{context}']
= Connecting to Gmail
:context: gmail

To trigger execution of an integration when a particular Gmail
account receives an email, add a Gmail connection to a simple integration as its
start connection. In an integration, to send an email from a
particular Gmail account, do either of the following: 

* Add a Gmail connection to the middle of a flow.
* Add a Gmail connection to finish a simple integration.

The general steps for connecting to Gmail in an integration are:

. link:{LinkSyndesisConnectorGuide}#register-with-google_google[Registering {prodname} as a Google client application].
. Creating a Gmail connection. When you do this you choose the Gmail account that
the connection is authorized to access.
. If your integration sends an email from a Gmail account, 
decide how to populate an email to send.
. Adding a Gmail connection to an integration flow.
. For a Gmail connection that sends an email, optionally mapping integration
data to the email fields. 

Information and instructions are in the following topics:

* xref:create-gmail-connection_{context}[]
* xref:alternatives-for-populating-email-to-send_{context}[]
* xref:add-gmail-connection-start_{context}[]
* xref:add-gmail-connection-finish-middle_{context}[]

include::../../modules/connecting/proc-create-gmail-connection.adoc[leveloffset=+1]

include::../../modules/connecting/ref-alternatives-for-populating-email-to-send.adoc[leveloffset=+1]

include::../../modules/connecting/proc-add-gmail-connection-start.adoc[leveloffset=+1]

include::../../modules/connecting/proc-add-gmail-connection-finish-middle.adoc[leveloffset=+1]


:context: google
