sendr
Sendr - An email library for Gleam
Types
Errors related to attachment fields during validation.
pub type AttachmentField {
RequiredFilenameMissing
RequiredContentIdMissing
AttachmentTypeNotSupported
}
Constructors
-
RequiredFilenameMissing -
RequiredContentIdMissing -
AttachmentTypeNotSupported
Errors related to the message body during validation.
pub type BodyField {
NoBody
TextToShort(minimum: Int, length: Int)
HtmlToShort(minimum: Int, length: Int)
}
Constructors
-
NoBody -
TextToShort(minimum: Int, length: Int) -
HtmlToShort(minimum: Int, length: Int)
Represents the fields of an email message that can be validated.
pub type Field {
From
ReplyTo
To
Cc
Bcc
Subject
}
Constructors
-
From -
ReplyTo -
To -
Cc -
Bcc -
Subject
The top-level error type for a Sendr backend.
error is the backend-specific error type (e.g. connection or API errors).
Validation errors use the other variants directly; backend errors are
wrapped in BackendError.
pub type SendrError(error) {
RequiredFieldMissing(field: Field)
FieldExceedsMaximumLength(
field: Field,
maximum: Int,
length: Int,
)
TooManyEntries(field: Field)
NoRecipients
InvalidMailbox(field: Field, mailbox: mailbox.Mailbox)
InvalidAttachment(
field: AttachmentField,
attachment: attachment.Attachment,
)
InvalidBody(BodyField)
BackendError(error)
}
Constructors
-
RequiredFieldMissing(field: Field) -
FieldExceedsMaximumLength( field: Field, maximum: Int, length: Int, ) -
TooManyEntries(field: Field) -
NoRecipients -
InvalidMailbox(field: Field, mailbox: mailbox.Mailbox) -
InvalidAttachment( field: AttachmentField, attachment: attachment.Attachment, ) -
InvalidBody(BodyField) -
BackendError(error)