Package io.mailtrap.api.apiresource
Class SendApiResource
java.lang.Object
io.mailtrap.api.apiresource.ApiResource
io.mailtrap.api.apiresource.ApiResourceWithValidation
io.mailtrap.api.apiresource.SendApiResource
- Direct Known Subclasses:
BulkEmailsImpl
,SendingEmailsImpl
,TestingEmailsImpl
Abstract class representing a resource for sending emails via Mailtrap API.
-
Field Summary
Fields inherited from class io.mailtrap.api.apiresource.ApiResourceWithValidation
mailtrapValidator
Fields inherited from class io.mailtrap.api.apiresource.ApiResource
apiHost, httpClient, token
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SendApiResource
(MailtrapConfig config, MailtrapValidator mailtrapValidator) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Validates the request body of batch email and throws an exception if it is invalid.protected void
Validates the request body of an email message and throws an exception if it is invalid.Methods inherited from class io.mailtrap.api.apiresource.ApiResourceWithValidation
validateRequestBodyAndThrowException
-
Constructor Details
-
SendApiResource
-
-
Method Details
-
validateMailPayload
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
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.
-