From fb9acfa696ea3f3ddc13a04315d91551b8dedaf6 Mon Sep 17 00:00:00 2001 From: Zach Richards Date: Fri, 9 Aug 2019 13:55:25 -0500 Subject: [PATCH] Log exceptions from emailing When SendMail throws an exception (e.g. settings.Email is blank), the details of the exception should be logged. --- Components/EmailTemplateController.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Components/EmailTemplateController.vb b/Components/EmailTemplateController.vb index 86023bf..fd41829 100755 --- a/Components/EmailTemplateController.vb +++ b/Components/EmailTemplateController.vb @@ -13,6 +13,7 @@ Imports Dotnetnuke.Entities.Portals Imports Dotnetnuke.Entities.Users Imports DotNetNuke.Framework Imports DotNetNuke.Security.Roles +Imports DotNetNuke.Services.Exceptions Namespace Ventrian.NewsArticles @@ -289,7 +290,8 @@ Namespace Ventrian.NewsArticles ' SendNotification(settings.Email, sendTo, Null.NullString, subject, template) Try DotNetNuke.Services.Mail.Mail.SendMail(settings.Email, sendTo, "", subject, template, "", "", "", "", "", "") - Catch + Catch exc As Exception + LogException(exc) End Try End Sub