Send email to organizers whenever a guest changes their attendance status #290

Merged
bustikiller merged 3 commits from status-change-email into main 2025-07-06 16:53:49 +00:00
Showing only changes of commit d236e459cd - Show all commits

View File

@ -22,7 +22,13 @@ class GuestsController < ApplicationController
end
def update
guest = Guest.find(params[:id]).update!(guest_params)
guest = Guest.find(params[:id])
guest.update!(guest_params)
if !user_signed_in? && guest.saved_change_to_status?
AdminMailer.with(guest_id: guest.id).attendance_change_email.deliver_later
end
render json: guest.as_json(GUEST_PARAMS), status: :ok
end