Skip to content

Public API booking does not trigger manager approval email for non-auto-accept rooms #14

@vst662-source

Description

@vst662-source

Environment:

  • Nextcloud 33.0.3
  • RoomVox 1.1.0

Steps to reproduce:

  1. Create a room with autoAccept = false and at least one assigned Manager
  2. Create a booking via POST /api/v1/rooms/{id}/bookings with an external organizer email
  3. Booking is created successfully with status: pending

Expected:
Manager receives the approval-request email (same as when the booking is created via the Nextcloud Calendar app).

Actual:
No email to the manager. The booker does receive a confirmation email after the manager approves, so the SMTP path itself is fine.

Verified:
The same room, same manager, same SMTP config — booked through Nextcloud Calendar — produces the manager approval email correctly. So the issue is specific to the public API booking path bypassing the Sabre iTIP scheduling plugin that emits the approval mail.

Possible cause: POST /api/v1/rooms/{id}/bookings writes directly to the room calendar without going through the iTIP pipeline where the manager-notification hook lives.


While looking into this, I found another issue with a similar result in lib/Service/CalDAVService.php (around line 961, inside createBooking()):

if ($organizer !== '') {
    $icsLines[] = 'ORGANIZER;CN=' . $this->escapeIcsText($organizer) . ':mailto:' . $organizer . '@localhost';
}

@localhost is unconditionally appended to $organizer. When the API is called with an external email address as organizer (my use case), this produces mailto:user@company.com@localhost — not a deliverable address. CN is also set to the email itself instead of a display name.

This looks like the same root issue as the missing manager notification: createBooking() writes directly into the room calendar and adds only the room as an ATTENDEE, bypassing the iTIP pipeline where the manager-approval hook lives. The whole API booking path seems to assume $organizer is an internal Nextcloud user ID (where @localhost would be a pseudo-domain suffix, similar to the rb_* service accounts).

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending approval or rejectionbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions