public async Task SendOCashOutRefundMail(string email, string assetId, double amount, string srcBlockchainHash, string refundTransaction, int validDays)
 {
     var msgData = new OrdinaryCashOutRefundData
     {
         AssetId           = assetId,
         Amount            = amount,
         SrcBlockchainHash = srcBlockchainHash,
         RefundTransaction = refundTransaction,
         ValidDays         = validDays
     };
     await _emailSender.SendEmailAsync(email, msgData);
 }
Esempio n. 2
0
        public async Task <EmailMessage> GenerateOrdinaryCashOutRefundMsg(OrdinaryCashOutRefundData refundData)
        {
            var templateVm = new OrdinaryCashOutDoneTemplate
            {
                Amount      = refundData.Amount,
                AssetId     = refundData.AssetId,
                ExplorerUrl = string.Format(_settings.BlockChainExplorerUrl, refundData.SrcBlockchainHash),
                Year        = DateTime.UtcNow.Year,
                ValidDays   = refundData.ValidDays > 0 ? refundData.ValidDays : _emailGeneratorSettings.RefundTimeoutInDays
            };

            var emailMessage = new EmailMessage
            {
                Body    = await _templateGenerator.GenerateAsync("OCashOutDoneTemplate", templateVm, TemplateType.Email),
                Subject = EmailResources.OrdinaryCashOut_done_Subject,
                IsHtml  = true
            };

            AddRefundAttachment(emailMessage, refundData.RefundTransaction);

            return(emailMessage);
        }