Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type DomainName = String
- data MailgunConfig = MailgunConfig {}
- class HasMailgunConfig c where
- mailgunConfig :: Lens' c MailgunConfig
- mailgunApiDomain :: Lens' c String
- mailgunApiKey :: Lens' c ByteString
- mailgunDomain :: Lens' c DomainName
- mailgunTestMode :: Lens' c Bool
- mailgunGetConfig :: (MonadIO m, MonadCatch m) => m MailgunConfig
- mailgunFromEnv :: (MonadIO m, MonadThrow m) => m MailgunConfig
- mailgunFromIni :: forall m. (MonadIO m, MonadThrow m) => m MailgunConfig
- data MailgunConfigException
- _MailgunApiKeyRequired :: Prism' MailgunConfigException ()
- _MailgunDomainRequired :: Prism' MailgunConfigException ()
- _MailgunInvalidRegion :: Prism' MailgunConfigException ()
- _MailgunIniNotFound :: Prism' MailgunConfigException ()
- _MailgunConextUnavailable :: Prism' MailgunConfigException ()
Documentation
type DomainName = String Source #
data MailgunConfig Source #
The configuration we use when accessing the Mailgun API.
MailgunConfig | |
|
Instances
Eq MailgunConfig Source # | |
Defined in Network.Mail.Mailgun.Config (==) :: MailgunConfig -> MailgunConfig -> Bool # (/=) :: MailgunConfig -> MailgunConfig -> Bool # | |
Show MailgunConfig Source # | |
Defined in Network.Mail.Mailgun.Config showsPrec :: Int -> MailgunConfig -> ShowS # show :: MailgunConfig -> String # showList :: [MailgunConfig] -> ShowS # | |
HasMailgunConfig MailgunConfig Source # | |
Defined in Network.Mail.Mailgun.Config mailgunConfig :: Lens' MailgunConfig MailgunConfig Source # mailgunApiDomain :: Lens' MailgunConfig String Source # mailgunApiKey :: Lens' MailgunConfig ByteString Source # mailgunDomain :: Lens' MailgunConfig DomainName Source # mailgunTestMode :: Lens' MailgunConfig Bool Source # |
class HasMailgunConfig c where Source #
mailgunConfig :: Lens' c MailgunConfig Source #
mailgunApiDomain :: Lens' c String Source #
mailgunApiKey :: Lens' c ByteString Source #
mailgunDomain :: Lens' c DomainName Source #
mailgunTestMode :: Lens' c Bool Source #
Instances
HasMailgunConfig MailgunConfig Source # | |
Defined in Network.Mail.Mailgun.Config mailgunConfig :: Lens' MailgunConfig MailgunConfig Source # mailgunApiDomain :: Lens' MailgunConfig String Source # mailgunApiKey :: Lens' MailgunConfig ByteString Source # mailgunDomain :: Lens' MailgunConfig DomainName Source # mailgunTestMode :: Lens' MailgunConfig Bool Source # |
mailgunGetConfig :: (MonadIO m, MonadCatch m) => m MailgunConfig Source #
Uses the available options to discover a MaingunConfig if possible.
mailgunFromEnv :: (MonadIO m, MonadThrow m) => m MailgunConfig Source #
Builds a MaingunConfig from enviromental variables.
MAILGUN_API_KEY: Required; the API key for mailgun.
MAILGUN_DOMAIN: Required; the domain in mailgun we're using.
MAILGUN_REGION: Optional; Selects teh regional API endpoint.
Valid values are US
, and EU
, defaults to US
.
MAILGUN_API_BASE: Optional; Override the base URL (primarily for testing).
Takes presidence over MAILGUN_REGION.
MAILGUN_LIVE: Optional: Unless set to True, set to test mode.
In test mode Mailgun accepts but does not send messages.
mailgunFromIni :: forall m. (MonadIO m, MonadThrow m) => m MailgunConfig Source #
Looks for an ini format file at ".mailgun" and "~/.mailgun" in that order.
Credentials are read from the ini in the format:
[mailgun]
region: US
domain: mydomain.com
key: 3ax6xnjp29jd6fds4gc373sgvjxteol0
api_domain: api.mailgun.com
live: True
The API key and domain are required, other values are optional.
data MailgunConfigException Source #
MailgunApiKeyRequired | |
MailgunDomainRequired | |
MailgunInvalidRegion | |
MailgunIniNotFound | |
MailgunConextUnavailable |
Instances
Show MailgunConfigException Source # | |
Defined in Network.Mail.Mailgun.Config showsPrec :: Int -> MailgunConfigException -> ShowS # show :: MailgunConfigException -> String # showList :: [MailgunConfigException] -> ShowS # | |
Exception MailgunConfigException Source # | |
_MailgunApiKeyRequired :: Prism' MailgunConfigException () Source #
_MailgunDomainRequired :: Prism' MailgunConfigException () Source #
_MailgunInvalidRegion :: Prism' MailgunConfigException () Source #
_MailgunIniNotFound :: Prism' MailgunConfigException () Source #
_MailgunConextUnavailable :: Prism' MailgunConfigException () Source #