Prompt Chain

Connect ChatGPT to Outlook for Email & Calendar Tasks

A GPT Actions guide connecting a Custom GPT to Outlook via Azure OAuth, so ChatGPT can read and send mail and manage calendar events.

Works with outlookmicrosoft graphazure

69
Spark score
out of 100
Updated 9 days ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Leverage ChatGPT's natural language capabilities to directly interact with your Outlook account, enabling seamless management of emails and calendar events.

Outcomes

What it gets done

01

Summarize your daily meetings and calendar events.

02

Send emails directly from ChatGPT outputs.

03

Retrieve and manage emails and calendar entries.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/oai-gptactionoutlook | bash

Steps

Steps in the chain

01
App Registration
02
Certificate & Secrets
03
API Permissions
04
Configure Authentication in ChatGPT
05
Add Redirect URI

Overview

GPT Action Library: Outlook

A GPT Actions Library guide connecting a Custom GPT to Outlook via Azure Active Directory OAuth, letting the GPT send and retrieve emails and calendar events on the user's behalf. Use it when building a Custom GPT that needs Outlook mail and calendar access. Requires Azure admin-level access to register an app first.

What it does

A GPT Actions Library guide for connecting a Custom GPT to Outlook, Microsoft's email and calendar web service, via OAuth through Azure Active Directory/Entra ID. The guide's stated value: it lets users leverage ChatGPT's natural-language capability to connect directly to Outlook. Once connected, the GPT can send and retrieve emails and calendar events on the user's behalf - for example, looking up a day's meetings and having ChatGPT summarize them, or emailing a ChatGPT output directly to someone.

When to use - and when NOT to

Use it when building a Custom GPT that needs to read or send Outlook mail and manage calendar events through natural-language requests. It requires access to register an App in Azure Active Directory/Entra ID first, so it is not usable without that Azure admin-level access.

Inputs and outputs

Setup happens on two sides. In Azure: (1) register a new App in the Azure Portal, leaving the Redirect URI blank initially; (2) under Certificate & secrets, generate a client secret and save its Value field (only visible once, at creation); (3) under API permissions, add Microsoft Graph delegated permissions Calendars.ReadWrite, Mail.Read, Mail.Send, and User.Read. In ChatGPT's Authentication panel, select OAuth and enter the Client ID (the Azure app's Application (client) ID, found on its Overview page) and the Client Secret saved earlier. The Authorization URL is https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/authorize and the Token URL is https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/token, with <Tenant_ID> replaced by the app's Directory (tenant) ID (also from the Overview page); the Scope is https://graph.microsoft.com/User.Read https://graph.microsoft.com/Mail.Send https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/Calendars.ReadWrite, with Token Exchange Method left at its Default (POST Request) setting.

Finally, copy the GPT Action's callback URL and add it as a Redirect URI under the Azure app's Authentication > Add a platform > Web settings. The guide's own troubleshooting note: a callback URL error in ChatGPT usually means the Callback URL value has changed and needs rechecking, since it can shift when the authentication setup is altered.

Integrations

Connects ChatGPT's Custom GPT / GPT Actions framework to the Microsoft Graph API - the interface behind Outlook mail and calendar - authenticated via Azure Active Directory/Entra ID OAuth. The guide points to the Azure Portal as the application website and Microsoft's own Graph API overview docs for the underlying API reference.

Who it's for

Developers building a Custom GPT Action that needs Outlook email and calendar access on a user's behalf, who have (or can obtain) permission to register an app in their organization's Azure Active Directory.

Source README

GPT Action Library: Outlook

Introduction

This page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information:

This particular GPT Action provides an overview of how to connect to Outlook, Microsoft's web service for emailing and calendar events. This action assumes a user’s context and allows them to send and retrieve emails and calendar events from Outlook.

Value + Example Business Use Cases

Value: Users can now leverage ChatGPT's natural language capability to connect directly to Outlook

Example Use Cases:

  • A user can look up all of their meetings for the day and have ChatGPT summarize the day
  • A user can email a ChatGPT output to someone directly

Application Information

Application Key Links

Check out these links from the application before you get started:

Application Prerequisites

Before you get started, make sure you go through the following steps in your application environment:

ChatGPT Steps

Custom GPT Instructions

Once you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out Getting Started Example to see how this step works in more detail.

OpenAPI Schema

Once you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out Getting Started Example to see how this step works in more detail.

Authentication Instructions

Below are instructions on setting up authentication with Outlook. Have questions? Check out Getting Started Example to see how this step works in more detail.

Azure Steps

  1. App Registration: The first step is to register a new App registration in the Azure Portal which will be used to integrate OAuth between our application and Azure Active Directory/Entra ID. Simply provide the application with a relevant name, leaving the Redirect URI blank for now as we will return to this, and save.

  2. Certificate & Secrets: We next need to generate a client secret to provide secure communication between the GPT and Azure. Within the App registration, navigate to Certificate & secrets in the sidebar

Click New client secret and create a new client secret with desired name and expiry date. Clicking save will provide us a Secret to use in our GPT creation. Make sure to save the Value field as it’ll only be visible at creation, and we will need it later!

  1. API Permissions: The next step is to provide the integration with the scope it needs to perform our specific required actions.
    Within the App registration, navigate to Manage > API permissions in the sidebar.

Click Add a permission and Microsoft graph > Delegated Permissions as options in the opened side menu. Use the search bar to add the following permissions:

  • Calendars.ReadWrite
  • Mail.Read
  • Mail.Send
  • User.Read

In ChatGPT

In ChatGPT, click on "Authentication" and choose "OAuth". Enter in the information below.

  • Client ID: The value listed on the Azure Registered App’s Overview page under Application (client) ID
  • Client Secret: the secret Value saved from step 2 of Azure Steps

For the following two inputs, replace with the value listed on the Registered App’s Overview page under Directory (tenant) ID

Post-Action Steps

Once you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action.

  • Copy the callback URL from the GPT Action

  • In the Azure app, navigate to the Manage > Authentication tab, click Add a platform, select Web and add your callback URL under Redirect URI

FAQ & Troubleshooting

  • Callback URL Error: If you get a callback URL error in ChatGPT, double check the Callback URL value as it can occasionally change depending on any alterations made to the authentication

Are there integrations that you’d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we’ll take a look.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.