Package com.io7m.idstore.server.internal

# Class IdServerMailService

java.lang.Object
com.io7m.idstore.server.internal.IdServerMailService

All Implemented Interfaces:
  `IdServiceType`, `AutoCloseable`

public final class IdServerMailService extends Object implements IdServiceType, AutoCloseable
A mail service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `static IdServerMailService`
  `create(Clock clock, IdServerTelemetryService telemetry, IdServerEventBusService events, IdServerMailConfiguration configuration)`
  Create a new mail service.
  `String`
  `description()`
  `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.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### create

    public static IdServerMailService create(Clock clock, IdServerTelemetryService telemetry, IdServerEventBusService events, IdServerMailConfiguration configuration)
    Create a new mail service.
    Parameters:
      `clock` - The clock
      `telemetry` - The telemetry service
      `events` - The event bus service
      `configuration` - 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 metrics
      `requestId` - The request ID
      `to` - The target address
      `subject` - The message subject
      `text` - The message text
      `headers` - Extra message headers
    Returns:
      The send in progress

  - ### description

    public String description()
    Specified by:
      `description` in interface `IdServiceType`
    Returns:
      The service description

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### close

    public void close() throws Exception
    Specified by:
      `close` in interface `AutoCloseable`
    Throws:
      `Exception`