Interface IMailService
- Namespace
- NuvTools.Notification.Mail
- Assembly
- NuvTools.Notification.Mail.dll
Provides email sending, regardless of the underlying infrastructure.
public interface IMailService
Remarks
This is the only contract the application layer needs to depend on. Provider specific packages contain nothing but the implementation and its configuration.
Methods
SendAsync(MailMessage, CancellationToken)
Send mail based on selected infraestructure.
Task<MailSendResult> SendAsync(MailMessage mailMessage, CancellationToken cancellationToken = default)
Parameters
mailMessageMailMessageMessage abstraction containg the content and its recipients.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<MailSendResult>
The provider reference of the accepted send request.
Exceptions
- NotSupportedException
Thrown when the message uses a feature the provider cannot honor, such as ScheduledFor, Tags or Variables.