Package com.io7m.idstore.server.internal
Class IdServerMailService
java.lang.Object
com.io7m.idstore.server.internal.IdServerMailService
- All Implemented Interfaces:
IdServiceType,AutoCloseable
A mail service.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static IdServerMailServicecreate(Clock clock, IdServerTelemetryService telemetry, IdServerEventBusService events, IdServerMailConfiguration configuration) Create a new mail service.sendMail(io.opentelemetry.api.trace.Span parentSpan, UUID requestId, IdEmail to, Map<String, String> headers, String subject, String text) Send a message to the given target address.toString()
-
Method Details
-
create
public static IdServerMailService create(Clock clock, IdServerTelemetryService telemetry, IdServerEventBusService events, IdServerMailConfiguration configuration) Create a new mail service.- Parameters:
clock- The clocktelemetry- The telemetry serviceevents- The event bus serviceconfiguration- The mail configuration- Returns:
- The service
-
sendMail
public CompletableFuture<Void> sendMail(io.opentelemetry.api.trace.Span parentSpan, UUID requestId, IdEmail to, Map<String, String> headers, String subject, String text) Send a message to the given target address.- Parameters:
parentSpan- The parent span for metricsrequestId- The request IDto- The target addresssubject- The message subjecttext- The message textheaders- Extra message headers- Returns:
- The send in progress
-
description
- Specified by:
descriptionin interfaceIdServiceType- Returns:
- The service description
-
toString
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-