mailgun-0.2: API binding for Mailgun

Safe HaskellNone
LanguageHaskell2010

Network.Mail.Mailgun.Config

Synopsis

Documentation

data MailgunConfig Source #

The configuration we use when accessing the Mailgun API.

Constructors

MailgunConfig 

Fields

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.