Send email to organizers whenever a guest changes their attendance status #290
@ -22,7 +22,13 @@ class GuestsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
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
|
render json: guest.as_json(GUEST_PARAMS), status: :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user