mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Update email invite flag
This commit is contained in:
@@ -28,8 +28,8 @@ namespace BTCPayServer.Client.Models
|
||||
public bool? IsAdministrator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Flag to specify if email invitation should be sent to the user. https://github.com/btcpayserver/btcpayserver/issues/6406#issuecomment-2886252217
|
||||
/// Flag to specify if an email invitation should be sent to the user.
|
||||
/// </summary>
|
||||
public bool? SkipEmailInvite { get; set; }
|
||||
public bool? SendInvitationEmail { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,8 +358,6 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
Created = DateTimeOffset.UtcNow,
|
||||
Approved = isAdmin // auto-approve first admin and users created by an admin
|
||||
};
|
||||
if (request.SkipEmailInvite == true)
|
||||
user.RequiresEmailConfirmation = false;
|
||||
|
||||
var blob = user.GetBlob() ?? new();
|
||||
blob.Name = request.Name;
|
||||
@@ -418,7 +416,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
var currentUser = await _userManager.GetUserAsync(User);
|
||||
var userEvent = currentUser switch
|
||||
{
|
||||
{ } invitedBy => await UserEvent.Invited.Create(user, invitedBy, _callbackGenerator, Request, true),
|
||||
{ } invitedBy => await UserEvent.Invited.Create(user, invitedBy, _callbackGenerator, Request, request.SendInvitationEmail is not false),
|
||||
_ => await UserEvent.Registered.Create(user, _callbackGenerator, Request)
|
||||
};
|
||||
_eventAggregator.Publish(userEvent);
|
||||
|
||||
@@ -271,6 +271,12 @@
|
||||
"description": "Make this user administrator (only if you have the `unrestricted` permission of a server administrator)",
|
||||
"nullable": true,
|
||||
"default": false
|
||||
},
|
||||
"sendInvitationEmail": {
|
||||
"type": "boolean",
|
||||
"description": "Flag to specify if an email invitation should be sent to the user",
|
||||
"nullable": true,
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user