Package com.io7m.idstore.server.service.mail

# Class IdServerMailService

java.lang.Object
com.io7m.idstore.server.service.mail.IdServerMailService

All Implemented Interfaces:
  `IdServerMailServiceType`, `com.io7m.repetoir.core.RPServiceType`, `AutoCloseable`

public final class IdServerMailService extends Object implements IdServerMailServiceType
A mail service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `static IdServerMailServiceType`
  `create(IdServerTelemetryServiceType telemetry, 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 IdServerMailServiceType create(IdServerTelemetryServiceType telemetry, IdServerMailConfiguration configuration)
    Create a new mail service.
    Parameters:
      `telemetry` - The telemetry 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)
    Description copied from interface: `IdServerMailServiceType`
    Send a message to the given target address.
    Specified by:
      `sendMail` in interface `IdServerMailServiceType`
    Parameters:
      `parentSpan` - The parent span for metrics
      `requestId` - The request ID
      `to` - The target address
      `headers` - Extra message headers
      `subject` - The message subject
      `text` - The message text
    Returns:
      The send in progress

  - ### description

    public String description()
    Specified by:
      `description` in interface `com.io7m.repetoir.core.RPServiceType`

  - ### toString

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

  - ### close

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