/** @return InviteResource */
public function resend(string $id, int|float|null $timeout = null): arrayRe-delivers the email for an invite that is still pending. Nothing new is created: the invite keeps its id, its token and its original expiresAt, which means resending does not buy the recipient more time. An invite that has already expired cannot be rescued this way, so revoke it and send a fresh one with $envless->members->invite().
A resend is not rate limited. There is no cap on how many times one invite can be sent again and no cooldown between calls, so a recipient who lost the email can be sent another one immediately. Only two things refuse the call:
| Condition | Status | Message |
|---|---|---|
| No pending invite with that id in the workspace | 404 | Invite not found. |
| The invite has already expired | 409 | This invitation has expired. Revoke it and invite the address again to send a fresh link. |
The returned invite always has 'role' => null on this route, since the endpoint does not re-resolve the role. Read the role from a list call if you need it. resendCount and lastResendAt do reflect the bump.
Example
use Envless\Envless;
$envless = new Envless();
$invite = $envless->invites->resend('0192a4be-5c1f-7d40-8e2b-6a9c3f1d7e55');
echo "{$invite['resendCount']} {$invite['lastResendAt']}", PHP_EOL;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$id | string | Yes | Invite id taken from a list call. |
$timeout | int|float | No | Seconds each attempt of this call may take, the response body included, before it throws Envless\Exception\NetworkException with isTimeout() true. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
InviteResource for the same invite, with an incremented resendCount and a null role.
Worth knowing
- There is no request body and the success status is 200, not 201.
resendCountis bumped before the email is handed off, but a failed send rolls it back along withlastResendAt, so a 500 leaves the counters where they were.resendCountandlastResendAtare bookkeeping only. Nothing is enforced against them, so read them to see how often an invite has been chased rather than to work out what is left.- Both counters are per invite, not per address. Revoking a pending invite and inviting the address again starts a fresh count with a fresh expiry.
Required scopes
members:write
Underlying endpoint
POST /invites/{id}/resend
Request and response schema, every error code, and a live playground.
In TypeScript
envless.invites.resend()
The same method in @goenvless/sdk, with the same request, retries and errors.