Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- initSMTP :: Logger -> Text -> Maybe PortNumber -> Maybe (Username, Password) -> SMTPConnType -> IO SMTP
- emailViaSMTPInterpreter :: Member (Embed IO) r => Logger -> SMTP -> InterpreterFor EmailSending r
- sendMailWithDuration :: forall t m. (MonadIO m, TimeUnit t) => t -> Logger -> SMTP -> Mail -> m ()
- initSMTP' :: TimeUnit t => t -> Logger -> Text -> Maybe PortNumber -> Maybe (Username, Password) -> SMTPConnType -> IO SMTP
- data SMTPConnType
- data SMTP = SMTP {
- pool :: !(Pool SMTPConnection)
- newtype Username = Username Text
- newtype Password = Password Text
- data SMTPPoolException
Documentation
initSMTP :: Logger -> Text -> Maybe PortNumber -> Maybe (Username, Password) -> SMTPConnType -> IO SMTP Source #
Initiate the SMTP
connection pool
Throws exceptions when the SMTP server is unreachable, authentication fails, a timeout happens, or on every other network failure.
defaultTimeoutDuration
is used as timeout duration for all actions.
emailViaSMTPInterpreter :: Member (Embed IO) r => Logger -> SMTP -> InterpreterFor EmailSending r Source #
sendMailWithDuration :: forall t m. (MonadIO m, TimeUnit t) => t -> Logger -> SMTP -> Mail -> m () Source #
sendMail
with configurable timeout duration
This is mostly useful for testing. (We don't want to waste the amount of
defaultTimeoutDuration
in tests with waiting.)
initSMTP' :: TimeUnit t => t -> Logger -> Text -> Maybe PortNumber -> Maybe (Username, Password) -> SMTPConnType -> IO SMTP Source #
initSMTP
with configurable timeout duration
This is mostly useful for testing. (We don't want to waste the amount of
defaultTimeoutDuration
in tests with waiting.)
data SMTPConnType Source #
Instances
FromJSON SMTPConnType Source # | |
Defined in Wire.EmailSending.SMTP parseJSON :: Value -> Parser SMTPConnType Source # parseJSONList :: Value -> Parser [SMTPConnType] Source # | |
ToJSON SMTPConnType Source # | |
Defined in Wire.EmailSending.SMTP toJSON :: SMTPConnType -> Value Source # toEncoding :: SMTPConnType -> Encoding Source # toJSONList :: [SMTPConnType] -> Value Source # toEncodingList :: [SMTPConnType] -> Encoding Source # | |
Show SMTPConnType Source # | |
Defined in Wire.EmailSending.SMTP showsPrec :: Int -> SMTPConnType -> ShowS # show :: SMTPConnType -> String # showList :: [SMTPConnType] -> ShowS # | |
Eq SMTPConnType Source # | |
Defined in Wire.EmailSending.SMTP (==) :: SMTPConnType -> SMTPConnType -> Bool # (/=) :: SMTPConnType -> SMTPConnType -> Bool # |
data SMTPPoolException Source #
Instances
Exception SMTPPoolException Source # | |
Defined in Wire.EmailSending.SMTP | |
Show SMTPPoolException Source # | |
Defined in Wire.EmailSending.SMTP showsPrec :: Int -> SMTPPoolException -> ShowS # show :: SMTPPoolException -> String # showList :: [SMTPPoolException] -> ShowS # | |
Eq SMTPPoolException Source # | |
Defined in Wire.EmailSending.SMTP (==) :: SMTPPoolException -> SMTPPoolException -> Bool # (/=) :: SMTPPoolException -> SMTPPoolException -> Bool # |