A lot of Misc Fixes (#2656)

This commit is contained in:
Joe Milazzo 2024-01-27 12:53:58 -06:00 committed by GitHub
parent 088af37960
commit b1e9d8cbba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 116 additions and 92 deletions

View file

@ -500,4 +500,16 @@ public class SettingsController : BaseApiController
// NOTE: This must match Hangfire's underlying cron system. Hangfire is unique
return Ok(CronHelper.IsValidCron(cronExpression));
}
/// <summary>
/// Sends a test email to see if email settings are hooked up correctly
/// </summary>
/// <returns></returns>
[Authorize(Policy = "RequireAdminRole")]
[HttpPost("test-email-url")]
public async Task<ActionResult<EmailTestResultDto>> TestEmailServiceUrl()
{
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId());
return Ok(await _emailService.SendTestEmail(user!.Email));
}
}