Examples are unclear. Also, using UNIT Test Mock references make it even more unclear.
I have not tried this yet but would this work based off of how the old version worked?
If this works then please use something like this for an example. If this does not work can you provide a better example?
INewEmailModel mailmodel = new NewEmailModel();
mailmodel.From = "joe@joe.com";
mailmodel.To = "sam@sam.com";
mailmodel.Name = "sam spade";
mailmodel.Subject = : Password Reset by Admin Notification";
mailmodel.NewPassword = "mypassword123";
new MailController().PasswordResetEmail(mailmodel).DeliverAsync();
//In Controller
public EmailResult PasswordResetEmail(INewEmailModel model)
{
SetHeaders(model);
return Email("PasswordResetEmail", model);
}
private void SetHeaders(INewEmailModel model)
{
SetMailMethod(MailMethod.SMTP);
MailAttributes.To.Add(new MailAddress(model.To));
if (!string.IsNullOrWhiteSpace(model.Cc)) MailAttributes.Cc.Add(new MailAddress(model.Cc));
if (!string.IsNullOrWhiteSpace(model.Bcc)) MailAttributes.Bcc.Add(new MailAddress(model.Bcc));
MailAttributes.From = new MailAddress(model.From);
MailAttributes.From = new MailAddress(model.Subject);
}
Examples are unclear. Also, using UNIT Test Mock references make it even more unclear.
I have not tried this yet but would this work based off of how the old version worked? If this works then please use something like this for an example. If this does not work can you provide a better example?