-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Mailtrap API library. -- -- Mailtrap API library. For more information, visit the -- repository. @package mailtrap @version 0.1.2.1 -- | Mailtrap API. module Network.Mail.Mailtrap -- | Authorization token. newtype Token Token :: Text -> Token -- | Exceptions thrown by functions from this module. data Exception -- | API request returned list of errors. HTTP status code and error -- messages. MultipleErrors :: Int -> [Text] -> Exception -- | API request returned a single error message. HTTP status code and -- error message. SingleError :: Int -> Text -> Exception -- | Parsing failed. Input that failed to parse plus error message. ParsingError :: ByteString -> String -> Exception -- | Mailtrap account ID. newtype AccountID AccountID :: Int -> AccountID -- | Mailtrap account. data Account Account :: AccountID -> Text -> Account [account_id] :: Account -> AccountID [account_name] :: Account -> Text -- | Get all the accounts the given token has access to. getAllAccounts :: Token -> IO [Account] -- | Attachment disposition. data Disposition -- | Inline with identifier. Inline :: Text -> Disposition Attached :: Disposition -- | Set an attachment's disposition. setDisposition :: Disposition -> Attachment -> Attachment -- | File that can be attached to an e-mail. data Attachment Attachment :: Text -> MimeType -> ByteString -> Disposition -> Attachment -- | File name. [attachment_name] :: Attachment -> Text -- | MIME type of the content. [attachment_type] :: Attachment -> MimeType -- | Attachment content. [attachment_content] :: Attachment -> ByteString -- | Attachment disposition. [attachment_disposition] :: Attachment -> Disposition -- | Create an attachment from a file. It guesses the mime type from the -- file extension. Disposition is set to Attached. The file is -- read strictly. attachmentFromFile :: FilePath -> IO Attachment -- | Template that can be used when sending e-mails. data Template Template :: UUID -> Object -> Template -- | ID of the template. [template_id] :: Template -> UUID -- | Template variable assignments. [template_variables] :: Template -> Object -- | Template with no variable set. template :: UUID -> Template -- | Set template variable. setTemplateVariable :: ToJSON a => Text -> a -> Template -> Template -- | Testing inbox identifier. newtype InboxID InboxID :: Int -> InboxID -- | Testing inbox. data Inbox Inbox :: InboxID -> Text -> Int -> Int -> Int -> Inbox [inbox_id] :: Inbox -> InboxID [inbox_name] :: Inbox -> Text -- | Number of emails in the inbox. [inbox_emailCount] :: Inbox -> Int -- | Number of unread emails in the inbox. [inbox_unreadCount] :: Inbox -> Int [inbox_maxSize] :: Inbox -> Int -- | Get all inboxes from an account. getInboxes :: Token -> AccountID -> IO [Inbox] -- | Inbox message identifier. newtype InboxMessageID InboxMessageID :: Int -> InboxMessageID -- | A message in a testing inbox. data InboxMessage InboxMessage :: InboxMessageID -> InboxID -> UTCTime -> EmailAddress -> EmailAddress -> Text -> Bool -> InboxMessage [inboxMessage_id] :: InboxMessage -> InboxMessageID [inboxMessage_inbox] :: InboxMessage -> InboxID [inboxMessage_sentAt] :: InboxMessage -> UTCTime [inboxMessage_from] :: InboxMessage -> EmailAddress [inboxMessage_to] :: InboxMessage -> EmailAddress [inboxMessage_subject] :: InboxMessage -> Text [inboxMessage_isRead] :: InboxMessage -> Bool -- | Get all inbox messages from an testing inbox. getInboxMessages :: Token -> AccountID -> InboxID -> IO [InboxMessage] -- | Download inbox message raw email body. downloadMessageRaw :: Token -> AccountID -> InboxID -> InboxMessageID -> IO Text -- | Download inbox message in EML format. downloadMessageEML :: Token -> AccountID -> InboxID -> InboxMessageID -> IO Text -- | Download inbox message text part. downloadMessageText :: Token -> AccountID -> InboxID -> InboxMessageID -> IO Text -- | Download inbox message HTML part. downloadMessageHTML :: Token -> AccountID -> InboxID -> InboxMessageID -> IO Text -- | Represents an email address. data () => EmailAddress -- | Attempt to parse an e-mail address parseEmailAddress :: ByteString -> Either String EmailAddress -- | An e-mail address with a name. data NamedEmailAddress NamedEmailAddress :: EmailAddress -> Text -> NamedEmailAddress [emailAddress] :: NamedEmailAddress -> EmailAddress [emailAddressName] :: NamedEmailAddress -> Text -- | Production message identifier. newtype MessageID MessageID :: UUID -> MessageID -- | E-mail message, including subject and body. data Message Message :: Text -> EmailBody -> Text -> Message [message_subject] :: Message -> Text [message_body] :: Message -> EmailBody -- | Message category. [message_category] :: Message -> Text -- | An e-mail body. data EmailBody -- | Plain-text body. PlainTextBody :: Text -> EmailBody -- | HTML-only body. HTMLOnlyBody :: Html -> EmailBody -- | HTML body with text fallback. HTMLBody :: Html -> Text -> EmailBody -- | E-mail that can be sent using sendEmail. data Email Email :: NamedEmailAddress -> [NamedEmailAddress] -> [NamedEmailAddress] -> [NamedEmailAddress] -> [Attachment] -> Object -> Either Template Message -> Email -- | Sender address. [email_from] :: Email -> NamedEmailAddress -- | Recipient list. Max 1000. [email_to] :: Email -> [NamedEmailAddress] -- | Carbon Copy recipients. [email_cc] :: Email -> [NamedEmailAddress] -- | Blind Carbon Copy recipients. [email_bcc] :: Email -> [NamedEmailAddress] -- | Files attached to the e-mail. [email_attachments] :: Email -> [Attachment] -- | Custom JSON object. [email_custom] :: Email -> Object -- | Message to send. [email_message] :: Email -> Either Template Message -- | Send an e-mail and return the list of IDs of the messages sent (one -- per recipient). sendEmail :: Token -> Email -> IO [MessageID] -- | Send a testing e-mail to the given inbox and return the list of IDs of -- the messages sent (one per recipient). sendTestEmail :: Token -> InboxID -> Email -> IO [InboxMessageID] instance GHC.Show.Show Network.Mail.Mailtrap.Token instance GHC.Classes.Eq Network.Mail.Mailtrap.Token instance GHC.Show.Show Network.Mail.Mailtrap.Exception instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.AccountID instance GHC.Show.Show Network.Mail.Mailtrap.AccountID instance GHC.Classes.Eq Network.Mail.Mailtrap.AccountID instance GHC.Show.Show Network.Mail.Mailtrap.Account instance GHC.Show.Show Network.Mail.Mailtrap.NamedEmailAddress instance GHC.Show.Show Network.Mail.Mailtrap.Disposition instance GHC.Show.Show Network.Mail.Mailtrap.Attachment instance GHC.Show.Show Network.Mail.Mailtrap.Template instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.InboxID instance GHC.Show.Show Network.Mail.Mailtrap.InboxID instance GHC.Classes.Eq Network.Mail.Mailtrap.InboxID instance GHC.Show.Show Network.Mail.Mailtrap.Inbox instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.InboxMessageID instance GHC.Show.Show Network.Mail.Mailtrap.InboxMessageID instance GHC.Classes.Eq Network.Mail.Mailtrap.InboxMessageID instance GHC.Show.Show Network.Mail.Mailtrap.InboxMessage instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.MessageID instance GHC.Show.Show Network.Mail.Mailtrap.MessageID instance GHC.Classes.Eq Network.Mail.Mailtrap.MessageID instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.InboxMessage instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.Inbox instance Data.Aeson.Types.ToJSON.ToJSON Network.Mail.Mailtrap.Email instance Data.Aeson.Types.ToJSON.ToJSON Network.Mail.Mailtrap.Attachment instance Data.Aeson.Types.ToJSON.ToJSON Network.Mail.Mailtrap.NamedEmailAddress instance Data.Aeson.Types.ToJSON.ToJSON Network.Mail.Mailtrap.EmailAddressJSON instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.EmailAddressJSON instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.Account instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Network.Mail.Mailtrap.AsText a) instance (GHC.TypeLits.KnownSymbol k, Data.Aeson.Types.FromJSON.FromJSON a) => Data.Aeson.Types.FromJSON.FromJSON (Network.Mail.Mailtrap.JSONResp k a) instance GHC.Exception.Type.Exception Network.Mail.Mailtrap.Exception instance Data.Aeson.Types.FromJSON.FromJSON Network.Mail.Mailtrap.Token instance Data.Aeson.Types.ToJSON.ToJSON Network.Mail.Mailtrap.Token