MICROSOFT GRAPH EMAIL PROFORMA INSTALLATION
==========================================

FILES TO UPLOAD
---------------

1) /rooms/config/microsoft_graph.php
2) /rooms/includes/microsoft_graph_mailer.php
3) /rooms/modules/payments/email_proforma.php

SQL
---

Run booking_email_log.sql in phpMyAdmin.

AZURE SETUP
-----------

1) Go to:
   Azure Portal > Microsoft Entra ID > App registrations

2) New registration:
   Name: Pure Africa PMS Email
   Account type: Single tenant

3) Copy:
   Tenant ID
   Client ID

4) Certificates & secrets:
   New client secret
   Copy the VALUE immediately

5) API permissions:
   Microsoft Graph > Application permissions
   Mail.Send

6) Click:
   Grant admin consent

7) Optional but recommended:
   Restrict the app so it can only send as reservations@pure.africa
   using Exchange Online Application Access Policy.

CONFIG
------

Edit:

/rooms/config/microsoft_graph.php

Set:

MS_GRAPH_TENANT_ID
MS_GRAPH_CLIENT_ID
MS_GRAPH_CLIENT_SECRET
MS_GRAPH_SENDER_EMAIL

CALENDAR MENU
-------------

Add right-click menu options pointing to:

/rooms/modules/payments/email_proforma.php?order_id=ORDER_ID&type=standard
/rooms/modules/payments/email_proforma.php?order_id=ORDER_ID&type=master
/rooms/modules/payments/email_proforma.php?order_id=ORDER_ID&type=room
/rooms/modules/payments/email_proforma.php?order_id=ORDER_ID&type=guest

TYPES
-----

standard = proforma_invoice.php
master   = proforma_master_folio.php
room     = proforma_room_account.php
guest    = guest_folios.php

NOTES
-----

This does not use Outlook, Thunderbird, SendGrid, SMTP, or mailto.
It sends from Microsoft 365 using Graph API and attaches the PDF automatically.
