Mail: diagnose van SMTP-weigeringen en keuze bij een nieuwe uitnodigingslink
SMTP: bij een geweigerd commando logt de verzender fase, statuscode en de eerste regel van het serverantwoord (adressen vervangen, max 120 tekens); specifiekere foutcodes (rejected_sender, rejected_recipient, tls_failed, connection_failed) die de beheerder in het venster ziet; opstartlog met SMTP-host, poort en standaard afzenderdomein. Uit de property-test: besturingstekens worden eerst verwijderd, anders kon een adres weer aan elkaar plakken. Nieuwe uitnodigingslink: regenerate-invite mailt alleen met sendEmail=true (standaard false); eerst een keuzevenster 'Alleen link kopieren' / 'Link kopieren en mailen' (zonder mail alleen de link). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -166,10 +166,11 @@ public class UsersController : ControllerBase
|
||||
|
||||
/// <summary>
|
||||
/// Issues a fresh link for an open (or expired) invitation: new token and a new lifetime. The
|
||||
/// old link stops working. Until e-mail exists this is how an administrator re-sends one.
|
||||
/// old link stops working. It is mailed only when the request says <c>sendEmail: true</c> (the administrator
|
||||
/// is asked); otherwise the link is just returned so it can be copied and shared.
|
||||
/// </summary>
|
||||
[HttpPost("{invitationId:guid}/regenerate-invite")]
|
||||
public async Task<IActionResult> RegenerateInvite(Guid invitationId)
|
||||
public async Task<IActionResult> RegenerateInvite(Guid invitationId, [FromBody] RegenerateInviteRequest? request = null)
|
||||
{
|
||||
var invitation = await GetInvitationAsync(invitationId);
|
||||
if (invitation is null) return NotFound();
|
||||
@@ -180,8 +181,12 @@ public class UsersController : ControllerBase
|
||||
var token = await _invitationService.RegenerateInvitationAsync(invitationId);
|
||||
if (token is null) return NotFound();
|
||||
|
||||
var link = $"/invite/complete?token={Uri.EscapeDataString(token)}";
|
||||
if (request?.SendEmail != true)
|
||||
return Ok(new { inviteLink = link, mail = (object?)null });
|
||||
|
||||
var mail = await _mail.SendInvitationAsync(invitation.Email, token, invitation.Language, isNewLink: true, HttpContext.RequestAborted);
|
||||
return Ok(new { inviteLink = $"/invite/complete?token={Uri.EscapeDataString(token)}", mail = MailBody(mail) });
|
||||
return Ok(new { inviteLink = link, mail = MailBody(mail) });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user