# OL Rescue Outlook **Office Web Add-in** that recreates the old “OL Helper” workflow for **New Outlook** (and Outlook on the web): you define a **Tracking ID** and an **Inbox subfolder name**, then the add-in uses **Microsoft Graph** to create the folder (if needed) and move messages that contain `TrackingID#…` in the subject or preview. Classic COM/VSTO add-ins do not run in New Outlook. The supported path is **Office.js + Graph**, which this project uses. ## What you need - **Node.js 20+** and npm (for local HTTPS dev and builds). - **Microsoft 365 / Outlook** with add-ins allowed by your org. - An **Azure AD app registration** (see below) with Graph delegated permissions: **Mail.ReadWrite**, **User.Read**. ## Azure AD app (summary) 1. In [Azure Portal](https://portal.azure.com) → **Microsoft Entra ID** → **App registrations** → **New registration**. 2. Name it (e.g. “OL Rescue”), supported account types per your tenant, **Redirect URI**: platform **Single-page application (SPA)**, URI `https://localhost:3000` (and later your production URL). 3. **API permissions** → **Microsoft Graph** → **Delegated**: add **Mail.ReadWrite**, **User.Read** → **Grant admin consent** if required. 4. **Overview** → copy **Application (client) ID**. ## Run locally ```bash cd "/path/to/OL Rescue!" cp .env.example .env # Set VITE_AZURE_CLIENT_ID to your client ID npm install npm run dev ``` Vite serves **HTTPS** on port **3000** (self-signed cert; your browser will warn once). ## Sideload the manifest in Outlook (Windows New Outlook) 1. Ensure `manifest.xml` still points to `https://localhost:3000/index.html` (default for dev). 2. In Outlook: **File** → **Manage Add-ins** / **Get Add-ins** → **My add-ins** → **Add a custom add-in** → **Add from file…** → choose `manifest.xml`. If your org blocks custom add-ins, an admin may need to deploy via **Centralized Deployment** or allow sideloading. ## Use the add-in 1. Open a ticket email and open the **OL Rescue** task pane. 2. **Sign in with Microsoft** (Graph consent). 3. **Fill from open message** to parse `TrackingID#…` and suggest a folder name, or type **Tracking ID** and **Inbox folder name** manually. 4. **Save case**, then **Create folder & move mail** on that case to create `Inbox\` and move matching messages. Saved cases are stored in **browser localStorage** for this add-in origin. ## Production 1. Host the `dist/` folder (or your static host) over **HTTPS**. 2. Update **Application ID URI / redirect URIs** in Azure for your real origin. 3. Edit **manifest.xml** `SourceLocation`, `IconUrl`, and `SupportUrl` to your HTTPS URLs, then rebuild (`npm run build`) and redeploy. ## Limits vs old OL Helper - **Not automatic on every new message** unless you add something else (e.g. Outlook rules calling a service, or Power Automate). This tool is **on-demand** from the task pane. - **Graph search** uses `$filter` on subject/body preview; very unusual formats might need a small follow-up change. - **Shared mailboxes** need extra Graph permissions and possibly UX changes; this MVP targets your primary mailbox (`/me/…`). ## License Use and modify for your work as needed.