Skip to content

Commit

Permalink
Updated email to use lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarwal4 authored and raymens committed Jun 25, 2024
1 parent b38c7ac commit 75d190f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task SendMailAsync(Mail mail, Customer customer, Transaction transa
}

var from = new EmailAddress(_mailOptions.Sender);
var to = new EmailAddress(mail.Recipient?.Email) ?? throw new CustomErrorsException("MailService", "toAddress", "An error occured while sending mail.");
var to = new EmailAddress(mail.Recipient?.Email?.ToLower().Trim()) ?? throw new CustomErrorsException("MailService", "toAddress", "An error occured while sending mail.");

var msg = new SendGridMessage();

Expand Down Expand Up @@ -83,7 +83,7 @@ public async Task SendMailAsync(Mail mail, Customer customer, Transaction transa
public async Task SendOTPCodeMailAsync(Customer customer, string otpCode)
{
var from = new EmailAddress(_mailOptions.Sender);
var to = new EmailAddress(customer.Email);
var to = new EmailAddress(customer.Email?.ToLower().Trim());
var msg = new SendGridMessage();

msg.SetFrom(new EmailAddress(from.Email, from.Name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task CreateAsync(Customer customer, string? ip = null, Cancellation

var query = new Dictionary<string, string>
{
{ "Email", customer.Email.TrimEnd() }
{ "Email", customer.Email.ToLower().Trim() }
};

var existingCustomersWithEmail = await _tokenServer.Customers.Get(query);
Expand All @@ -60,7 +60,7 @@ public async Task CreateAsync(Customer customer, string? ip = null, Cancellation
BankAccountNumber = null
}
])
.SetEmail(customer.Email)
.SetEmail(customer.Email.ToLower().Trim())
.SetStatus(status)
.SetCustomData(customer.Data);

Expand All @@ -84,7 +84,7 @@ public async Task UpdateAsync(Customer customer, CancellationToken cancellationT
}

var builder = new UpdateCustomerRequestBuilder(customer.CustomerCode)
.SetEmail(customer.Email)
.SetEmail(customer.Email.ToLower().Trim())
.SetStatus(status)
.SetCustomData(customer.Data);

Expand Down

0 comments on commit 75d190f

Please sign in to comment.