Class SendApiResource

Direct Known Subclasses:
BulkEmailsImpl, SendingEmailsImpl, TestingEmailsImpl

public abstract class SendApiResource extends ApiResourceWithValidation
Abstract class representing a resource for sending emails via Mailtrap API.
  • Constructor Details

  • Method Details

    • validateMailPayload

      protected void validateMailPayload(MailtrapMail mail)
      Validates the request body of an email message and throws an exception if it is invalid.
      Parameters:
      mail - The email message to be validated.
      Throws:
      InvalidRequestBodyException - If the request body is invalid.
    • validateBatchPayload

      protected void validateBatchPayload(MailtrapBatchMail batch)
      Validates the request body of batch email and throws an exception if it is invalid.
      Parameters:
      batch - batch request to be validated.
      Throws:
      InvalidRequestBodyException - If the request body is invalid.