An event-based Office.js add-in that automatically injects a remotely-managed HTML signature whenever a user opens a new compose window in Outlook. No task pane, no user interaction — it just works silently in the background.
Signature content is served from Cloudflare Pages, meaning it can be updated without touching the add-in or re-sideloading the manifest.
- User opens a new compose window in Outlook
- Outlook fires the
OnNewMessageComposeevent commands.jsfetchessignature.htmlfrom Cloudflare Pages- The signature is injected via
setSignatureAsync()(falls back tobody.setAsync()on older builds) - No UI, no button, no task pane
├── manifest.xml # Add-in manifest — sideloaded locally into Outlook
├── commands.js # Event handler — hosted on Cloudflare Pages
├── signature.html # HTML signature fragment — hosted on Cloudflare Pages
├── _headers # Cloudflare Pages CORS header config
└── README.md
- Outlook for Mac (2023 or later)
- Microsoft 365 account signed into Outlook
- A Cloudflare Pages account (free tier)
- A GitHub account
git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
cd YOUR_REPO_NAMEEdit signature.html with your real name, title, contact details, and logo URL.
- Log in to Cloudflare Dashboard → Workers & Pages → Create
- Connect your GitHub account and select this repository
- Set build configuration:
- Build command: (leave empty)
- Build output directory:
/
- Click Save and Deploy
Your files will be live at https://YOUR_PROJECT_NAME.pages.dev.
The _headers file automatically sets permissive CORS headers on commands.js and signature.html — no extra configuration needed.
Open manifest.xml and replace every instance of YOUR_DOMAIN with your Cloudflare Pages URL:
<bt:Url id="Commands.Url" DefaultValue="https://YOUR_PROJECT_NAME.pages.dev/commands.js"/>Also replace the <Id> field with a fresh GUID. On macOS:
uuidgenUpdate commands.js too:
const SIGNATURE_URL = "https://YOUR_PROJECT_NAME.pages.dev/signature.html";Push the changes — Cloudflare Pages will redeploy automatically.
- Open Outlook
- Insert → Add-ins → My Add-ins → ··· → Add a Custom Add-in → Add from File…
- Select your local
manifest.xml - Open a new compose window — the signature will appear automatically
Edit signature.html and push to main. Cloudflare Pages redeploys in seconds. No manifest changes, no re-sideloading required.
Signature doesn’t appear after sideloading
- Open
commands.jsandsignature.htmlURLs directly in a browser to confirm they’re live and returning the expected content - Check that all
YOUR_DOMAINplaceholders inmanifest.xmlhave been replaced - Confirm the
<Id>inmanifest.xmlis a valid GUID
Add-in loads but signature is blank
- Open browser DevTools on the Cloudflare Pages URL and check for CORS errors
- Verify the
_headersfile is present in the repo root and has deployed correctly
setSignatureAsync has no effect
- Outlook respects the user’s native signature settings — if a default signature is already configured in Outlook preferences, the API will not overwrite it. Remove the native signature under Outlook → Preferences → Signatures and try again.
Manifest rejected silently by Outlook
- Validate the XML is well-formed (no unclosed tags, no stray placeholder text)
- Ensure the Cloudflare Pages URLs are HTTPS
This is a proof of concept. The sideloaded manifest approach works for development and internal testing without requiring Microsoft 365 admin access or AppSource publishing. For a production rollout, the manifest would be deployed via the Microsoft 365 admin centre, making the add-in available to all users in an organisation automatically.
MIT