Wave/Wave/Services/IEmailService.cs
Mia Rose Winter 1193d76838
Some checks failed
Docker Release / build (push) Has been cancelled
GitHub Release / Generate Release (push) Has been cancelled
Added Smtp reconnect on connection loss
2024-04-08 11:46:54 +02:00

16 lines
705 B
C#

namespace Wave.Services;
public interface IEmailService : IAsyncDisposable {
ValueTask ConnectAsync(CancellationToken cancellation);
ValueTask DisconnectAsync(CancellationToken cancellation);
ValueTask SendEmailAsync(IEmail email, CancellationToken cancellation = default);
}
public sealed class NoOpEmailService : IEmailService {
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
public ValueTask ConnectAsync(CancellationToken cancellation) => ValueTask.CompletedTask;
public ValueTask DisconnectAsync(CancellationToken cancellation) => ValueTask.CompletedTask;
public ValueTask SendEmailAsync(IEmail email, CancellationToken cancellation = default) => ValueTask.CompletedTask;
}