private string GetAccountStrategyAlertBody(AccountInfoDTO accountInfoDTO, AccountAlertDTO accountAlertDTO) { var body = $"Account : {accountInfoDTO.AccountName} alert triggered! \n"; body = body + $". Strategy {accountAlertDTO.StrategyId} min balance was : {accountAlertDTO.MinBalance} exceeded for {accountAlertDTO.StrategyDaysToCheck} days"; return(body); }
private string GetAccountAlertBody(AccountInfoDTO accountInfoDTO, AccountAlertDTO accountAlertDTO) { var body = $"Account : {accountInfoDTO.AccountName} alert triggered! \n"; body = body + $"account equity is {accountInfoDTO.AccountEquity} and the alert limit was {accountAlertDTO.MinBalance}"; return(body); }
public void SendAccountStrategyAlert(AccountInfoDTO accountInfoDTO, AccountAlertDTO accountAlertDTO) { var client = new SendGridClient(GetApiKey()); var from = new EmailAddress(GetSender()); var subject = GetAccountAlertSubject(); var to = new EmailAddress(GetReceiver()); var plainTextContent = GetAccountStrategyAlertBody(accountInfoDTO, accountAlertDTO); var htmlContent = "<strong>" + GetAccountStrategyAlertBody(accountInfoDTO, accountAlertDTO) + "</strong>"; var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent); var response = client.SendEmailAsync(msg); response.Wait(); }