mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Added resend invitation endpoint
This commit is contained in:
committed by
Constantin Graf
parent
9973368156
commit
53ba60bbe5
@@ -12,7 +12,9 @@ use App\Models\Organization;
|
||||
use App\Models\OrganizationInvitation;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Laravel\Jetstream\Contracts\InvitesTeamMembers;
|
||||
use Laravel\Jetstream\Mail\TeamInvitation;
|
||||
|
||||
class InvitationController extends Controller
|
||||
{
|
||||
@@ -64,6 +66,22 @@ class InvitationController extends Controller
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resend email for a pending invitation
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId resendInvitationEmail
|
||||
*/
|
||||
public function resend(Organization $organization, OrganizationInvitation $invitation): JsonResponse
|
||||
{
|
||||
$this->checkPermission($organization, 'invitations:resend', $invitation);
|
||||
|
||||
Mail::to($invitation->email)->send(new TeamInvitation($invitation));
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a pending invitation
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user