public async Task SendPurchaseConfirmationAsync(ConfirmationEmailParameters confirmationParameters, int accountId) { var applicationUser = await accountRepository_.Value.FindUserByAccountIdAsync(accountId); var userProfileInfo = await creyRestClient_.GetUserProfileAsync(accountId); var templateParameters = new Dictionary <string, string>() { { "USER_NAME", userProfileInfo.DisplayName }, { "CLIENT_ID", accountId.ToString() }, { "CLIENT_COUNTRY", confirmationParameters.OrderLocation }, { "INVOICE_NO", confirmationParameters.InvoiceId.ToString() }, { "PAYMENT_DATE", $"{confirmationParameters.PaymentDate.UtcDateTime.ToLongDateString()}" }, { "CURRENCY", confirmationParameters.Currency }, { "PAYMENT_METHOD", confirmationParameters.PaymentMethod }, { "ITEM_DESCRIPTION", confirmationParameters.ItemDescription }, { "VAT_PERCENTAGE", confirmationParameters.VatPercentage.ToString() }, { "VAT_AMOUNT", confirmationParameters.VatAmount.ToString() }, { "TOTAL_AMOUNT", confirmationParameters.TotalAmount.ToString() } }; await SendEmailTemplateAsync(applicationUser.Email, "invoice", templateParameters); var internalInvoiceParameters = templateParameters; internalInvoiceParameters.Add("USER_EMAIL", applicationUser.Email); internalInvoiceParameters.Add("ITEM_PRICE", confirmationParameters.ItemPrice.ToString()); await SendEmailTemplateAsync(internalInvoiceEmailAddress_, "internal-invoice", internalInvoiceParameters); }
public async Task <ActionResult> SendPurchaseConfirmation(ConfirmationEmailParameters confirmationParameters, int accountId) { await emailSender_.Value.SendPurchaseConfirmationAsync(confirmationParameters, accountId); return(Ok()); }
public async Task <ActionResult> SendPurchaseConfirmation(ConfirmationEmailParameters confirmationParameters) { await emailSender_.Value.SendPurchaseConfirmationAsync(confirmationParameters, User.IntoSessionInfo().AccountId); return(Ok()); }