Installer: Fix issues with newsletter signup (#20705)

* Add setter to allow handling of requests to subscribe to newsletter on install.

* Correct serialization of newsletter subscription request.

* Fix serialization and use the Umbraco.EmailMarketing service for newsletter signup.

* Remove logging of user when setting telemetry level.

* Applied suggestions from code review.
This commit is contained in:
Andy Butland
2025-11-07 14:34:26 +01:00
committed by GitHub
parent b866c31105
commit ca08652a60
3 changed files with 119 additions and 56 deletions

View File

@@ -39,11 +39,10 @@ public class MetricsConsentService : IMetricsConsentService
return analyticsLevel;
}
public async Task SetConsentLevelAsync(TelemetryLevel telemetryLevel)
public Task SetConsentLevelAsync(TelemetryLevel telemetryLevel)
{
IUser? currentUser = _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser ?? await _userService.GetAsync(Constants.Security.SuperUserKey);
_logger.LogInformation("Telemetry level set to {telemetryLevel} by {username}", telemetryLevel, currentUser?.Username);
_logger.LogInformation("Telemetry level set to {telemetryLevel}", telemetryLevel);
_keyValueService.SetValue(Key, telemetryLevel.ToString());
return Task.CompletedTask;
}
}