This commit is contained in:
Kukks
2023-12-08 11:09:23 +01:00
parent 07d5f26e7a
commit 11f9d8f379
6 changed files with 93 additions and 111 deletions

View File

@@ -238,24 +238,30 @@ public class TicketTailorService : EventHostedServiceBase
}
await _invoiceRepository.UpdateInvoiceMetadata(invoice.Id, invoice.StoreId, invoice.Metadata.ToJObject());
await _invoiceRepository.AddInvoiceLogs(invoice.Id, invLogs);
var uri = new Uri(btcpayUrl);
var url =
_linkGenerator.GetUriByAction("Receipt",
"TicketTailor",
new {invoiceId = invoice.Id},
uri.Scheme,
new HostString(uri.Host),
uri.AbsolutePath);
try
if (settings.SendEmail)
{
var sender = await _emailSenderFactory.GetEmailSender(issueTicket.Invoice.StoreId);
sender.SendEmail(MailboxAddress.Parse(email), "Your ticket is available now.",
$"Your payment has been settled and the event ticket has been issued successfully. Please go to <a href='{url}'>{url}</a>");
}
catch (Exception e)
{
// ignored
var uri = new Uri(btcpayUrl);
var url =
_linkGenerator.GetUriByAction("Receipt",
"TicketTailor",
new {invoiceId = invoice.Id},
uri.Scheme,
new HostString(uri.Host),
uri.AbsolutePath);
try
{
var sender = await _emailSenderFactory.GetEmailSender(issueTicket.Invoice.StoreId);
sender.SendEmail(MailboxAddress.Parse(email), "Your ticket is available now.",
$"Your payment has been settled and the event ticket has been issued successfully. Please go to <a href='{url}'>{url}</a>");
}
catch (Exception e)
{
// ignored
}
}
}
catch (Exception e)