# Deploying Gmail

{% hint style="info" %}
Navigate to Incidents -> Download Plugin -> Gmail Addon
{% endhint %}

***

### 1. Download plugin files

Navigate to **Incidents** and click the **Download Plugin** button, then select the "Gmail Addon" option.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2FN89h523OHYZWopzjrgeg%2Fimage.png?alt=media&#x26;token=e8fc990f-59c6-46f7-9a2e-05c942bbf8a8" alt=""><figcaption></figcaption></figure>

The addon will be deployed as a Google App, so the download contains two files in an archive:

1. `code.js` - The plugin's runtime code.
2. `appsscript.json` - The plugin's metadata.

***

### 2. Create a new Google project

Go to <https://script.google.com/> and create a **New Project**.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2FDQqylyBJThEVXwiBfI9W%2Fimage.png?alt=media&#x26;token=45732c6d-db0b-40c6-b2d3-55cd4e7ee7d9" alt="" width="563"><figcaption></figcaption></figure>

***

### 3. Edit Code.gs

When the project opens, copy the contents of `code.js` into the workspace and click the **Save** icon. If there is any code in the workspace file before you paste, remove it first.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2FFhHJRuVP24bX5TfnCFul%2Fimage.png?alt=media&#x26;token=8b441849-2469-4b05-bbc6-28dc3789133b" alt=""><figcaption><p>The file is named Code.gs by default</p></figcaption></figure>

***

### 4. Edit appsscript.json

Next, select the **Project Settings** icon from the options on the left and enable the option for "Show 'appsscript.json' metadata in editor". You should also select your time zone here.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2FSXhZAesHrZkjYRp0D8Z5%2Fimage.png?alt=media&#x26;token=a63c6e36-7981-40c0-8dc4-8796f0ad1bd1" alt="" width="563"><figcaption></figcaption></figure>

Return to the code editor and paste the contents of the `appscript.json` file that you downloaded into the `appscript.json` file in the editor. If there is any code in the workspace file before you paste, remove it first.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2Fkh8xdBHQ8EAiLBoYMBoa%2Fimage.png?alt=media&#x26;token=29d60e94-a0ae-43b5-8b18-50a7ab191689" alt=""><figcaption></figcaption></figure>

#### Metadata Options

Most of the fields in this object should be left alone, but there are a few worth checking before you deploy this project.

**Name:** The name of the add-on in your mail client. This name appears when you hover the mouse over the button.

**Logo URL:** A link to the button's image. The default is an image hosted by us, but you can host your own image and link to it here.

**Primary and Secondary Color:** Customize the color scheme. This field accepts hex codes, use a [hex code tool of your choice](https://www.google.com/search?q=color+hex+code+tool) to find the colors you like.

***

### 5. Deploy the project

Click **Deploy** and select "New Deployment". Make sure the addon type is both **Add-on** and **Web App**, and the options shown below for Web App are selected. When everything looks right, click **Deploy** and then click "Done".

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2F5Pxz2nryjCSneAQpm4Mf%2Fimage.png?alt=media&#x26;token=8251be23-a52e-44df-8246-2cd6fe39ad82" alt=""><figcaption></figcaption></figure>

***

### 6. Install the addon

Click **Deploy** again and this time select "Test Deployments", then select "Install".

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2F35TqVPArut2W7Q5AGBOL%2Fimage.png?alt=media&#x26;token=bf04352e-ee0a-4345-b6d9-73c8a5cc378a" alt=""><figcaption></figcaption></figure>
