| @@ -154,11 +154,19 @@ | ||
| 154 | 154 | |
| 155 | 155 | public function resend(Request $request, $invitationId) |
| 156 | 156 | { |
| 157 | 157 | $invitation = Invitation::findOrFail($invitationId); |
| 158 | + /** @var Invitation $invitation */ | |
| 158 | 159 | $user = $this->getUser(true); |
| 159 | 160 | $space = Space::findOrFail($invitation->post_id); |
| 160 | 161 | $space->verifyUserPermisson($user, 'community_moderator'); |
| 162 | + | |
| 163 | + // Links have no recipient; resending would mail an empty address and burn a redemption. | |
| 164 | + if (!is_email($invitation->message)) { | |
| 165 | + return $this->sendError([ | |
| 166 | + 'message' => __('Only email invitations can be resent.', 'fluent-community') | |
| 167 | + ]); | |
| 168 | + } | |
| 161 | 169 | |
| 162 | 170 | if ($invitation->reactions_count > 5) { |
| 163 | 171 | return $this->sendError([ |
| 164 | 172 | 'message' => __('You cannot resend this invitation', 'fluent-community') |