Moved more files to abstractions

This commit is contained in:
Bjarke Berg
2019-12-06 12:09:47 +01:00
parent fb562817bc
commit 86574c5e11
14 changed files with 53 additions and 40 deletions

View File

@@ -40,9 +40,12 @@ namespace Umbraco.Web.Editors
[IsCurrentUserModelFilter]
public class UsersController : UmbracoAuthorizedJsonController
{
private readonly IGlobalSettings _globalSettings;
public UsersController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
: base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
{
_globalSettings = globalSettings;
}
/// <summary>
@@ -343,7 +346,7 @@ namespace Umbraco.Web.Editors
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
}
if (EmailSender.CanSendRequiredEmail == false)
if (EmailSender.CanSendRequiredEmail(_globalSettings) == false)
{
throw new HttpResponseException(
Request.CreateNotificationValidationErrorResponse("No Email server is configured"));
@@ -473,7 +476,7 @@ namespace Umbraco.Web.Editors
await UserManager.EmailService.SendAsync(
//send the special UmbracoEmailMessage which configures it's own sender
//to allow for events to handle sending the message if no smtp is configured
new UmbracoEmailMessage(new EmailSender(true))
new UmbracoEmailMessage(new EmailSender(_globalSettings, true))
{
Body = emailBody,
Destination = userDisplay.Email,