This commit is contained in:
2022-11-21 00:53:58 +00:00
parent f412e6a66b
commit a9e8acf24b
3 changed files with 15 additions and 15 deletions

View File

@@ -1,2 +1,2 @@
todo: clean up solutions.txt and research.txt and move into a consolidated coding focused how-to.md doc todo: clean up solutions.txt and research.txt and move into a consolidated coding focused how-to.md doc
todo: test regular notification after case 4310 isn't broken by changes to mail delivery system

View File

@@ -233,7 +233,7 @@ namespace AyaNova.Api.Controllers
/// Send direct SMTP message notification so single object / address /// Send direct SMTP message notification so single object / address
/// Note: adds to queue, not instantly sent /// Note: adds to queue, not instantly sent
/// </summary> /// </summary>
/// <returns>NoContent on success or error</returns> /// <returns>Accepted on success or error</returns>
[HttpPost("direct-smtp")] [HttpPost("direct-smtp")]
public async Task<IActionResult> SendNotifySmtpDirectMessage([FromBody] NotifyDirectSMTP notifyDirectSMTP) public async Task<IActionResult> SendNotifySmtpDirectMessage([FromBody] NotifyDirectSMTP notifyDirectSMTP)
{ {
@@ -287,7 +287,7 @@ namespace AyaNova.Api.Controllers
IMailer m = AyaNova.Util.ServiceProviderProvider.Mailer; IMailer m = AyaNova.Util.ServiceProviderProvider.Mailer;
try try
{ {
await m.SendEmailAsync(notifyDirectSMTP.ToAddress, "Test from Notification system", "This is a test to confirm notification system is working", ServerGlobalOpsSettingsCache.Notify); await m.SendEmailAsync(notifyDirectSMTP.ToAddress, notifyDirectSMTP.Subject, notifyDirectSMTP.TextBody, ServerGlobalOpsSettingsCache.Notify,null,null,notifyDirectSMTP.HTMLBody);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -295,7 +295,7 @@ namespace AyaNova.Api.Controllers
return StatusCode(500, new ApiErrorResponse(ApiErrorCode.API_SERVER_ERROR, null, ExceptionUtil.ExtractAllExceptionMessages(ex))); return StatusCode(500, new ApiErrorResponse(ApiErrorCode.API_SERVER_ERROR, null, ExceptionUtil.ExtractAllExceptionMessages(ex)));
} }
return NoContent(); return Accepted();
} }
public class NotifyDirectSMTP public class NotifyDirectSMTP

View File

@@ -21,16 +21,16 @@ namespace AyaNova.Models
SmtpDeliveryActive = true; SmtpDeliveryActive = true;
Id = 1; Id = 1;
// #if (DEBUG) #if (DEBUG)
// SmtpDeliveryActive = true; SmtpDeliveryActive = true;
// SmtpServerAddress = "mail.ayanova.com"; SmtpServerAddress = "smtp.fastmail.com";
// SmtpAccount = "support@ayanova.com"; SmtpAccount = "support@onayanova.com";
// SmtpPassword = "e527b6c5a00c27bb61ca694b3de0ee178cbe3f1541a772774762ed48e9caf5ce"; SmtpPassword = "mk8pmhzlf5hvzgh5";
// ConnectionSecurity = NotifyMailSecurity.StartTls; ConnectionSecurity = NotifyMailSecurity.SSLTLS;
// SmtpServerPort = 465; SmtpServerPort = 587;
// NotifyFromAddress = "support@ayanova.com"; NotifyFromAddress = "support@ayanova.com";
// AyaNovaServerURL="http://localhost:8080"; AyaNovaServerURL = "http://localhost:8080";
// #else #else
SmtpDeliveryActive = false; SmtpDeliveryActive = false;
SmtpServerAddress = "mail.example.com"; SmtpServerAddress = "mail.example.com";
SmtpAccount = "notifydeliverfromaccount@example.com"; SmtpAccount = "notifydeliverfromaccount@example.com";
@@ -39,7 +39,7 @@ namespace AyaNova.Models
SmtpServerPort = 587; SmtpServerPort = 587;
NotifyFromAddress = "noreply@example.com"; NotifyFromAddress = "noreply@example.com";
AyaNovaServerURL = "https://url_to_my_ayanova_app"; AyaNovaServerURL = "https://url_to_my_ayanova_app";
//#endif #endif
} }
} }