This commit is contained in:
@@ -213,7 +213,7 @@ namespace AyaNova.Biz
|
|||||||
if (!KeepOnWorking()) return;
|
if (!KeepOnWorking()) return;
|
||||||
|
|
||||||
//NOTIFICATIONS
|
//NOTIFICATIONS
|
||||||
TaskUtil.Forget(Task.Run(() => CoreJobNotify.DoWorkAsync()));
|
TaskUtil.Forget(Task.Run(() => CoreJobNotify.DoWorkAsync()));//must fire and forget as it will call a report render job. In fact probably all of these can be fire and forget
|
||||||
// await CoreJobNotify.DoWorkAsync();
|
// await CoreJobNotify.DoWorkAsync();
|
||||||
|
|
||||||
if (!KeepOnWorking()) return;
|
if (!KeepOnWorking()) return;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace AyaNova.Util
|
|||||||
{
|
{
|
||||||
public interface IMailer
|
public interface IMailer
|
||||||
{
|
{
|
||||||
Task SendEmailAsync(string email, string subject, string body, AyaNova.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDF = null);
|
Task SendEmailAsync(string email, string subject, string body, AyaNova.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDF = null, string forceFileName = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Mailer : IMailer
|
public class Mailer : IMailer
|
||||||
@@ -19,7 +19,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SendEmailAsync(string email, string subject, string body, AyaNova.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDFPath = null)
|
public async Task SendEmailAsync(string email, string subject, string body, AyaNova.Models.GlobalOpsNotificationSettings smtpSettings, string attachPDFPath = null, string forceFileName = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -35,10 +35,11 @@ namespace AyaNova.Util
|
|||||||
Content = new MimeContent(File.OpenRead(attachPDFPath), ContentEncoding.Default),
|
Content = new MimeContent(File.OpenRead(attachPDFPath), ContentEncoding.Default),
|
||||||
ContentDisposition = new ContentDisposition(ContentDisposition.Attachment),
|
ContentDisposition = new ContentDisposition(ContentDisposition.Attachment),
|
||||||
ContentTransferEncoding = ContentEncoding.Base64,
|
ContentTransferEncoding = ContentEncoding.Base64,
|
||||||
FileName = Path.GetFileName("test.pdf")
|
FileName = Path.GetFileName(attachPDFPath)
|
||||||
//FileName = Path.GetFileName(attachPDFPath)
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
if (!string.IsNullOrWhiteSpace(forceFileName))
|
||||||
|
attachment.FileName = forceFileName;
|
||||||
|
|
||||||
var multipart = new Multipart("mixed");
|
var multipart = new Multipart("mixed");
|
||||||
if (!string.IsNullOrWhiteSpace(body))
|
if (!string.IsNullOrWhiteSpace(body))
|
||||||
|
|||||||
Reference in New Issue
Block a user