@extends('hms.layout') @section('title','Outlook email & calendar') @section('content')

Outlook email & calendar · {{ $organization->name }}

Use your organisation’s Microsoft 365 mailbox for HMS emails and synchronise appointments to linked clinicians’ Outlook calendars.

Your Microsoft 365 administrator must register an application in your tenant and grant Microsoft Graph application access for Mail.Send and Calendars.ReadWrite. Limit its Exchange access to the intended service and clinician mailboxes. Microsoft staff sign-in settings remain separate.
@csrf @method('PUT')
Stored encrypted. Leave blank to keep the saved secret. The saved value is never displayed.
Use a Microsoft 365 mailbox in this tenant. Emails use this address as the sender.

Calendar sync runs about once a minute when the server scheduler is active. Future appointments are added automatically. Link clinicians’ Microsoft Object IDs in Microsoft sign-in settings using the same tenant; staff sign-in does not need to be enabled. Calendar entries contain an appointment reference and a secure HMS link, with no patient names or clinical notes. Changes made in Outlook do not update HMS. Disabling sync leaves existing entries in Outlook.

@if($settings)

Check application credentials

Checks Microsoft authentication without sending an email or creating a calendar entry.

@csrf
@endif

Calendar sync activity

Failed updates retry up to five times with increasing delays. Correct the connection or clinician link before queuing another retry. Email delivery status remains in the appointment workflow.

@forelse($events as $event) @empty@endforelse
AppointmentStatusAttemptsLast syncedAction
#{{ $event->appointment_id }}{{ ucfirst($event->status) }}@if($event->last_error)
{{ $event->last_error }}
@endif
{{ $event->attempts }}{{ $event->synced_at ?? '—' }}@if($event->status==='failed')
@csrf
@endif
No calendar activity yet.
{{ $events->links() }}
@endsection