// This module is included in these assemblies:
// as_connecting-to-gmail.adoc

[id='create-gmail-connection_{context}']
= Creating a Gmail connection 

When you create a Gmail connection, you authorize the connection to access one
particular Gmail account. After you create a Gmail connection, you can 
add it to multiple integrations.

.Prerequisites
* You 
link:{LinkSyndesisConnectorGuide}#register-with-google_google[registered {prodname} as a Google client application] 
and enabled the Gmail API. 
* The {prodname} *Settings* page entry for Gmail has values for the client ID and client secret, which
you obtained by registering {prodname} as a Google client application. 

.Procedure

. In {prodname}, in the left panel, click *Connections* to
display any available connections.
. Click *Create Connection* to display
the available connectors. A connector is a template that
you use to create one or more connections.
. Click the *Gmail* connector.
. In the *Configure Connection* page, click *Connect Gmail*, 
which takes you to a *Sign in with Gmail* page.
+
If *Connect Gmail* does not display, your {prodname} environment
is not registered as a Google client application. See
link:{LinkSyndesisConnectorGuide}#register-with-google_google[Registering {prodname} as a Google client application].
When you try to create a Gmail connection and your {prodname} environment 
is not registered as a Google client application, then {prodname} displays
multiple fields that prompt for authorization information. While you can
create a Gmail connection by entering values in these fields, 
it is not recommended. 

. In the page that is prompting you to sign in to Gmail, 
enter the email address of the Google account that you want this connection to
access from {prodname} and click *Next*. 
. In response to *openshiftapps.com wants to access your Google Account*, 
click *Allow* to return to {prodname}.
. In the {prodname} *Name* field, enter your choice of a name that
helps you distinguish this connection from any other connections.
For example, enter `*Gmail Connect 1*`.
. In the *Description* field, optionally enter any information that
is helpful to know about this connection. For example,
enter `*Sample Gmail connection
that uses jkim Gmail account credentials.*`
. Click *Save* to see that the connection you
created is now available. If you entered the example name, you would
see that *Gmail Connect 1* appears as a connection that you can 
choose to add to an integration.
