-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Library for interfacing with the Mandrill JSON API -- @package mandrill @version 0.2.2.0 module Network.API.Mandrill.Settings mandrillUrl :: Text data MandrillCalls UsersInfo :: MandrillCalls UsersPing :: MandrillCalls UsersPing2 :: MandrillCalls UsersSenders :: MandrillCalls MessagesSend :: MandrillCalls MessagesSendTemplate :: MandrillCalls MessagesSearch :: MandrillCalls class MandrillEndpoint ep toUrl :: MandrillEndpoint ep => ep -> Text instance Show MandrillCalls instance MandrillEndpoint MandrillCalls module Network.API.Mandrill.Types timeParse :: ParseTime t => TimeLocale -> String -> String -> Maybe t data MandrillError MandrillError :: !Text -> !Int -> !Text -> !Text -> MandrillError _merr_status :: MandrillError -> !Text _merr_code :: MandrillError -> !Int _merr_name :: MandrillError -> !Text _merr_message :: MandrillError -> !Text merr_status :: Lens' MandrillError Text merr_name :: Lens' MandrillError Text merr_message :: Lens' MandrillError Text merr_code :: Lens' MandrillError Int data MandrillEmailStatus ES_Sent :: MandrillEmailStatus ES_Queued :: MandrillEmailStatus ES_Scheduled :: MandrillEmailStatus ES_Rejected :: MandrillEmailStatus ES_Invalid :: MandrillEmailStatus data MandrillRejectReason RR_HardBounce :: MandrillRejectReason RR_SoftBounce :: MandrillRejectReason RR_Spam :: MandrillRejectReason RR_Unsub :: MandrillRejectReason RR_Custom :: MandrillRejectReason RR_InvalidSender :: MandrillRejectReason RR_Invalid :: MandrillRejectReason RR_TestModeLimit :: MandrillRejectReason RR_Rule :: MandrillRejectReason -- | The main datatypes which models the response from the Mandrill API, -- which can be either a success or a failure. data MandrillResponse k MandrillSuccess :: k -> MandrillResponse k MandrillFailure :: MandrillError -> MandrillResponse k data MandrillRecipientTag To :: MandrillRecipientTag Cc :: MandrillRecipientTag Bcc :: MandrillRecipientTag -- | An array of recipient information. data MandrillRecipient MandrillRecipient :: EmailAddress -> Maybe Text -> Maybe MandrillRecipientTag -> MandrillRecipient -- | The email address of the recipient _mrec_email :: MandrillRecipient -> EmailAddress -- | The optional display name to use for the recipient _mrec_name :: MandrillRecipient -> Maybe Text -- | The header type to use for the recipient. defaults to "to" if not -- provided _mrec_type :: MandrillRecipient -> Maybe MandrillRecipientTag mrec_type :: Lens' MandrillRecipient (Maybe MandrillRecipientTag) mrec_name :: Lens' MandrillRecipient (Maybe Text) mrec_email :: Lens' MandrillRecipient EmailAddress newRecipient :: EmailAddress -> MandrillRecipient newtype MandrillHtml MandrillHtml :: Html -> MandrillHtml unsafeMkMandrillHtml :: Text -> MandrillHtml mkMandrillHtml :: Html -> MandrillHtml type MandrillTags = Text type MandrillHeaders = Value type MandrillVars = Value data MandrillMergeVars MandrillMergeVars :: !Text -> [MandrillVars] -> MandrillMergeVars _mmvr_rcpt :: MandrillMergeVars -> !Text _mmvr_vars :: MandrillMergeVars -> [MandrillVars] mmvr_vars :: Lens' MandrillMergeVars [MandrillVars] mmvr_rcpt :: Lens' MandrillMergeVars Text data MandrillMetadata MandrillMetadata :: !Text -> MandrillVars -> MandrillMetadata _mmdt_rcpt :: MandrillMetadata -> !Text _mmdt_values :: MandrillMetadata -> MandrillVars mmdt_values :: Lens' MandrillMetadata MandrillVars mmdt_rcpt :: Lens' MandrillMetadata Text newtype Base64ByteString B64BS :: ByteString -> Base64ByteString data MandrillWebContent MandrillWebContent :: !Text -> !Text -> !Base64ByteString -> MandrillWebContent _mwct_type :: MandrillWebContent -> !Text -- | _mwct_name :: MandrillWebContent -> !Text _mwct_content :: MandrillWebContent -> !Base64ByteString mwct_type :: Lens' MandrillWebContent Text mwct_name :: Lens' MandrillWebContent Text mwct_content :: Lens' MandrillWebContent Base64ByteString -- | The information on the message to send data MandrillMessage MandrillMessage :: MandrillHtml -> Maybe Text -> !Text -> EmailAddress -> Maybe Text -> [MandrillRecipient] -> MandrillHeaders -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Bool -> Maybe Bool -> [MandrillVars] -> [MandrillMergeVars] -> [MandrillTags] -> Maybe Text -> [Text] -> Maybe Text -> MandrillVars -> [MandrillMetadata] -> [MandrillWebContent] -> [MandrillWebContent] -> MandrillMessage -- | The full HTML content to be sent _mmsg_html :: MandrillMessage -> MandrillHtml -- | Optional full text content to be sent _mmsg_text :: MandrillMessage -> Maybe Text -- | The message subject _mmsg_subject :: MandrillMessage -> !Text -- | The sender email address _mmsg_from_email :: MandrillMessage -> EmailAddress -- | Optional from name to be used _mmsg_from_name :: MandrillMessage -> Maybe Text -- | A list of recipient information _mmsg_to :: MandrillMessage -> [MandrillRecipient] -- | optional extra headers to add to the message (most headers are -- allowed) _mmsg_headers :: MandrillMessage -> MandrillHeaders -- | whether or not this message is important, and should be delivered -- ahead of non-important messages _mmsg_important :: MandrillMessage -> Maybe Bool -- | whether or not to turn on open tracking for the message _mmsg_track_opens :: MandrillMessage -> Maybe Bool -- | whether or not to turn on click tracking for the message _mmsg_track_clicks :: MandrillMessage -> Maybe Bool -- | whether or not to automatically generate a text part for messages that -- are not given text _mmsg_auto_text :: MandrillMessage -> Maybe Bool -- | whether or not to automatically generate an HTML part for messages -- that are not given HTML _mmsg_auto_html :: MandrillMessage -> Maybe Bool -- | whether or not to automatically inline all CSS styles provided in the -- message HTML - only for HTML documents less than 256KB in size _mmsg_inline_css :: MandrillMessage -> Maybe Bool -- | whether or not to strip the query string from URLs when aggregating -- tracked URL data _mmsg_url_strip_qs :: MandrillMessage -> Maybe Bool -- | whether or not to expose all recipients in to To header for -- each email _mmsg_preserve_recipients :: MandrillMessage -> Maybe Bool -- | set to false to remove content logging for sensitive emails _mmsg_view_content_link :: MandrillMessage -> Maybe Bool -- | an optional address to receive an exact copy of each recipient's email _mmsg_bcc_address :: MandrillMessage -> Maybe Text -- | a custom domain to use for tracking opens and clicks instead of -- mandrillapp.com _mmsg_tracking_domain :: MandrillMessage -> Maybe Text -- | a custom domain to use for SPF/DKIM signing instead of mandrill (for -- "via" or "on behalf of" in email clients) _mmsg_signing_domain :: MandrillMessage -> Maybe Bool -- | a custom domain to use for the messages's return-path _mmsg_return_path_domain :: MandrillMessage -> Maybe Bool -- | whether to evaluate merge tags in the message. Will automatically be -- set to true if either merge_vars or global_merge_vars are provided. _mmsg_merge :: MandrillMessage -> Maybe Bool -- | global merge variables to use for all recipients. You can override -- these per recipient. _mmsg_global_merge_vars :: MandrillMessage -> [MandrillVars] -- | per-recipient merge variables, which override global merge variables -- with the same name. _mmsg_merge_vars :: MandrillMessage -> [MandrillMergeVars] -- | an array of string to tag the message with. Stats are accumulated -- using tags, though we only store the first 100 we see, so this should -- not be unique or change frequently. Tags should be 50 characters or -- less. Any tags starting with an underscore are reserved for internal -- use and will cause errors. _mmsg_tags :: MandrillMessage -> [MandrillTags] -- | the unique id of a subaccount for this message - must already exist or -- will fail with an error _mmsg_subaccount :: MandrillMessage -> Maybe Text -- | an array of strings indicating for which any matching URLs will -- automatically have Google Analytics parameters appended to their query -- string automatically. _mmsg_google_analytics_domains :: MandrillMessage -> [Text] -- | optional string indicating the value to set for the utm_campaign -- tracking parameter. If this isn't provided the email's from address -- will be used instead. _mmsg_google_analytics_campaign :: MandrillMessage -> Maybe Text -- | metadata an associative array of user metadata. Mandrill will store -- this metadata and make it available for retrieval. In addition, you -- can select up to 10 metadata fields to index and make searchable using -- the Mandrill search api. _mmsg_metadata :: MandrillMessage -> MandrillVars -- | Per-recipient metadata that will override the global values specified -- in the metadata parameter. _mmsg_recipient_metadata :: MandrillMessage -> [MandrillMetadata] -- | an array of supported attachments to add to the message _mmsg_attachments :: MandrillMessage -> [MandrillWebContent] -- | an array of embedded images to add to the message _mmsg_images :: MandrillMessage -> [MandrillWebContent] mmsg_view_content_link :: Lens' MandrillMessage (Maybe Bool) mmsg_url_strip_qs :: Lens' MandrillMessage (Maybe Bool) mmsg_tracking_domain :: Lens' MandrillMessage (Maybe Text) mmsg_track_opens :: Lens' MandrillMessage (Maybe Bool) mmsg_track_clicks :: Lens' MandrillMessage (Maybe Bool) mmsg_to :: Lens' MandrillMessage [MandrillRecipient] mmsg_text :: Lens' MandrillMessage (Maybe Text) mmsg_tags :: Lens' MandrillMessage [MandrillTags] mmsg_subject :: Lens' MandrillMessage Text mmsg_subaccount :: Lens' MandrillMessage (Maybe Text) mmsg_signing_domain :: Lens' MandrillMessage (Maybe Bool) mmsg_return_path_domain :: Lens' MandrillMessage (Maybe Bool) mmsg_recipient_metadata :: Lens' MandrillMessage [MandrillMetadata] mmsg_preserve_recipients :: Lens' MandrillMessage (Maybe Bool) mmsg_metadata :: Lens' MandrillMessage MandrillVars mmsg_merge_vars :: Lens' MandrillMessage [MandrillMergeVars] mmsg_merge :: Lens' MandrillMessage (Maybe Bool) mmsg_inline_css :: Lens' MandrillMessage (Maybe Bool) mmsg_important :: Lens' MandrillMessage (Maybe Bool) mmsg_images :: Lens' MandrillMessage [MandrillWebContent] mmsg_html :: Lens' MandrillMessage MandrillHtml mmsg_headers :: Lens' MandrillMessage MandrillHeaders mmsg_google_analytics_domains :: Lens' MandrillMessage [Text] mmsg_google_analytics_campaign :: Lens' MandrillMessage (Maybe Text) mmsg_global_merge_vars :: Lens' MandrillMessage [MandrillVars] mmsg_from_name :: Lens' MandrillMessage (Maybe Text) mmsg_from_email :: Lens' MandrillMessage EmailAddress mmsg_bcc_address :: Lens' MandrillMessage (Maybe Text) mmsg_auto_text :: Lens' MandrillMessage (Maybe Bool) mmsg_auto_html :: Lens' MandrillMessage (Maybe Bool) mmsg_attachments :: Lens' MandrillMessage [MandrillWebContent] type MandrillKey = Text newtype MandrillDate MandrillDate :: UTCTime -> MandrillDate fromMandrillDate :: MandrillDate -> UTCTime instance Show MandrillDate instance FromJSON MandrillDate instance ToJSON MandrillDate instance Arbitrary MandrillMessage instance FromJSON MandrillMessage instance ToJSON MandrillMessage instance Show MandrillMessage instance FromJSON MandrillWebContent instance ToJSON MandrillWebContent instance Show Base64ByteString instance Show MandrillWebContent instance FromJSON Base64ByteString instance ToJSON Base64ByteString instance FromJSON MandrillMetadata instance ToJSON MandrillMetadata instance Show MandrillMetadata instance FromJSON MandrillMergeVars instance ToJSON MandrillMergeVars instance Show MandrillMergeVars instance Arbitrary MandrillHtml instance FromJSON MandrillHtml instance ToJSON MandrillHtml instance Show MandrillHtml instance Monoid MandrillHtml instance Arbitrary MandrillRecipient instance FromJSON MandrillRecipient instance ToJSON MandrillRecipient instance Show MandrillRecipient instance FromJSON MandrillRecipientTag instance ToJSON MandrillRecipientTag instance Show k => Show (MandrillResponse k) instance Show MandrillRecipientTag instance FromJSON k => FromJSON (MandrillResponse k) instance FromJSON MandrillRejectReason instance ToJSON MandrillRejectReason instance Show MandrillRejectReason instance FromJSON MandrillEmailStatus instance ToJSON MandrillEmailStatus instance Show MandrillEmailStatus instance FromJSON MandrillError instance ToJSON MandrillError instance Show MandrillError module Network.API.Mandrill.Messages.Types data MessagesSendRq MessagesSendRq :: MandrillKey -> MandrillMessage -> Maybe Bool -> Maybe Text -> Maybe UTCTime -> MessagesSendRq _msrq_key :: MessagesSendRq -> MandrillKey _msrq_message :: MessagesSendRq -> MandrillMessage _msrq_async :: MessagesSendRq -> Maybe Bool _msrq_ip_pool :: MessagesSendRq -> Maybe Text _msrq_send_at :: MessagesSendRq -> Maybe UTCTime msrq_send_at :: Lens' MessagesSendRq (Maybe UTCTime) msrq_message :: Lens' MessagesSendRq MandrillMessage msrq_key :: Lens' MessagesSendRq MandrillKey msrq_ip_pool :: Lens' MessagesSendRq (Maybe Text) msrq_async :: Lens' MessagesSendRq (Maybe Bool) data MessagesResponse MessagesResponse :: !Text -> MandrillEmailStatus -> Maybe MandrillRejectReason -> !Text -> MessagesResponse -- | The email address of the recipient _mres_email :: MessagesResponse -> !Text -- | The sending status of the recipient _mres_status :: MessagesResponse -> MandrillEmailStatus -- | The reason for the rejection if the recipient status is "rejected" _mres_reject_reason :: MessagesResponse -> Maybe MandrillRejectReason -- | The message's unique id _mres__id :: MessagesResponse -> !Text mres_status :: Lens' MessagesResponse MandrillEmailStatus mres_reject_reason :: Lens' MessagesResponse (Maybe MandrillRejectReason) mres_email :: Lens' MessagesResponse Text mres__id :: Lens' MessagesResponse Text instance FromJSON MessagesResponse instance ToJSON MessagesResponse instance Show MessagesResponse instance FromJSON MessagesSendRq instance ToJSON MessagesSendRq instance Show MessagesSendRq module Network.API.Mandrill.Trans newtype MandrillT m a MandrillT :: ReaderT (MandrillKey, Manager) m a -> MandrillT m a runMandrillT :: MandrillT m a -> ReaderT (MandrillKey, Manager) m a type Mandrill = MandrillT IO runMandrill :: MonadIO m => MandrillKey -> MandrillT m a -> m a instance MonadTrans MandrillT instance Monad m => MonadReader (MandrillKey, Manager) (MandrillT m) instance Functor m => Functor (MandrillT m) instance Applicative m => Applicative (MandrillT m) instance Monad m => Monad (MandrillT m) instance MonadIO m => MonadIO (MandrillT m) module Network.API.Mandrill.Messages -- | Send a new transactional message through Mandrill send :: MandrillKey -> MandrillMessage -> Maybe Bool -> Maybe Text -> Maybe UTCTime -> Maybe Manager -> IO (MandrillResponse [MessagesResponse]) module Network.API.Mandrill.Users.Types data UsersRq UsersRq :: !MandrillKey -> UsersRq _ureq_key :: UsersRq -> !MandrillKey ureq_key :: Iso' UsersRq MandrillKey data MandrillStats MandrillStats :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> MandrillStats _msts_sent :: MandrillStats -> Int _msts_hard_bounces :: MandrillStats -> Int _msts_soft_bounces :: MandrillStats -> Int _msts_rejects :: MandrillStats -> Int _msts_complaints :: MandrillStats -> Int _msts_unsubs :: MandrillStats -> Int _msts_opens :: MandrillStats -> Int _msts_unique_opens :: MandrillStats -> Int _msts_clicks :: MandrillStats -> Int _msts_unique_clicks :: MandrillStats -> Int msts_unsubs :: Lens' MandrillStats Int msts_unique_opens :: Lens' MandrillStats Int msts_unique_clicks :: Lens' MandrillStats Int msts_soft_bounces :: Lens' MandrillStats Int msts_sent :: Lens' MandrillStats Int msts_rejects :: Lens' MandrillStats Int msts_opens :: Lens' MandrillStats Int msts_hard_bounces :: Lens' MandrillStats Int msts_complaints :: Lens' MandrillStats Int msts_clicks :: Lens' MandrillStats Int data UserStats UserStats :: MandrillStats -> MandrillStats -> MandrillStats -> MandrillStats -> MandrillStats -> MandrillStats -> UserStats _usts_today :: UserStats -> MandrillStats _usts_last_7_days :: UserStats -> MandrillStats _usts_last_30_days :: UserStats -> MandrillStats _usts_last_60_days :: UserStats -> MandrillStats _usts_last_90_days :: UserStats -> MandrillStats _usts_all_time :: UserStats -> MandrillStats usts_today :: Lens' UserStats MandrillStats usts_last_90_days :: Lens' UserStats MandrillStats usts_last_7_days :: Lens' UserStats MandrillStats usts_last_60_days :: Lens' UserStats MandrillStats usts_last_30_days :: Lens' UserStats MandrillStats usts_all_time :: Lens' UserStats MandrillStats data UsersInfoResponse UsersInfoResponse :: !Text -> MandrillDate -> !Text -> !Int -> !Int -> !Int -> UserStats -> UsersInfoResponse _usir_username :: UsersInfoResponse -> !Text _usir_created_at :: UsersInfoResponse -> MandrillDate _usir_public_id :: UsersInfoResponse -> !Text _usir_reputation :: UsersInfoResponse -> !Int _usir_hourly_quota :: UsersInfoResponse -> !Int _usir_backlog :: UsersInfoResponse -> !Int _usir_stats :: UsersInfoResponse -> UserStats usir_username :: Lens' UsersInfoResponse Text usir_stats :: Lens' UsersInfoResponse UserStats usir_reputation :: Lens' UsersInfoResponse Int usir_public_id :: Lens' UsersInfoResponse Text usir_hourly_quota :: Lens' UsersInfoResponse Int usir_created_at :: Lens' UsersInfoResponse MandrillDate usir_backlog :: Lens' UsersInfoResponse Int newtype UsersPingResponse UsersPingResponse :: Text -> UsersPingResponse data UsersPing2Response UsersPing2Response :: Text -> UsersPing2Response _usrr_PING :: UsersPing2Response -> Text data UsersSendersResponse UsersResponse :: !Text -> MandrillDate -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> UsersSendersResponse -- | The sender's email address _usrr_address :: UsersSendersResponse -> !Text -- | The date and time that the sender was first seen by Mandrill as a UTC -- date string in YYYY-MM-DD HH:MM:SS format _usrr_created_at :: UsersSendersResponse -> MandrillDate -- | The total number of messages sent by this sender _usrr_sent :: UsersSendersResponse -> !Int -- | The total number of hard bounces by messages by this sender _usrr_hard_bounces :: UsersSendersResponse -> !Int -- | The total number of soft bounces by messages by this sender _usrr_soft_bounces :: UsersSendersResponse -> !Int -- | The total number of rejected messages by this sender _usrr_rejects :: UsersSendersResponse -> !Int -- | The total number of spam complaints received for messages by this -- sender _usrr_complaints :: UsersSendersResponse -> !Int -- | The total number of unsubscribe requests received for messages by this -- sender _usrr_unsubs :: UsersSendersResponse -> !Int -- | The total number of times messages by this sender have been opened _usrr_opens :: UsersSendersResponse -> !Int -- | The total number of times tracked URLs in messages by this sender have -- been clicked _usrr_clicks :: UsersSendersResponse -> !Int -- | The number of unique opens for emails sent for this sender _usrr_unique_opens :: UsersSendersResponse -> !Int -- | The number of unique clicks for emails sent for this sender _usrr_unique_clicks :: UsersSendersResponse -> !Int usrr_unsubs :: Lens' UsersSendersResponse Int usrr_unique_opens :: Lens' UsersSendersResponse Int usrr_unique_clicks :: Lens' UsersSendersResponse Int usrr_soft_bounces :: Lens' UsersSendersResponse Int usrr_sent :: Lens' UsersSendersResponse Int usrr_rejects :: Lens' UsersSendersResponse Int usrr_opens :: Lens' UsersSendersResponse Int usrr_hard_bounces :: Lens' UsersSendersResponse Int usrr_created_at :: Lens' UsersSendersResponse MandrillDate usrr_complaints :: Lens' UsersSendersResponse Int usrr_clicks :: Lens' UsersSendersResponse Int usrr_address :: Lens' UsersSendersResponse Text instance FromJSON UsersSendersResponse instance ToJSON UsersSendersResponse instance Show UsersSendersResponse instance FromJSON UsersPing2Response instance ToJSON UsersPing2Response instance Show UsersPing2Response instance ToJSON UsersPingResponse instance FromJSON UsersPingResponse instance Show UsersPingResponse instance FromJSON UsersInfoResponse instance ToJSON UsersInfoResponse instance Show UsersInfoResponse instance FromJSON UserStats instance ToJSON UserStats instance Show UserStats instance FromJSON MandrillStats instance ToJSON MandrillStats instance Show MandrillStats instance FromJSON UsersRq instance ToJSON UsersRq instance Show UsersRq module Network.API.Mandrill.Users -- | Return the information about the API-connected user info :: MandrillKey -> Maybe Manager -> IO (MandrillResponse UsersInfoResponse) -- | Validate an API key and respond to a ping ping :: MandrillKey -> Maybe Manager -> IO (MandrillResponse UsersPingResponse) -- | Validate an API key and respond to a ping (anal JSON parser version) ping2 :: MandrillKey -> Maybe Manager -> IO (MandrillResponse UsersPing2Response) -- | Return the senders that have tried to use this account, both verified -- and unverified senders :: MandrillKey -> Maybe Manager -> IO (MandrillResponse [UsersSendersResponse]) -- | This package is an attempt to expose the Mandrill JSON API in pure -- Haskell. To do that, the library API comes in two flavours: -- -- module Network.API.Mandrill -- | The simplest way to use the API. All you need to provide is a valid -- MandrillMessage and this function will send an email inside a -- MandrillT transformer. You are not forced to use the -- MandrillT context though. Have a look at -- Network.API.Mandrill.Messages for an IO-based, low lever -- function for sending email. sendEmail :: MonadIO m => MandrillMessage -> MandrillT m (MandrillResponse [MessagesResponse]) -- | Builds an empty message, given only the email of the sender and the -- emails of the receiver. Please note that the Subject will be -- empty, so you need to use either newTextMessage or -- newHtmlMessage to populate it. emptyMessage :: EmailAddress -> [EmailAddress] -> MandrillMessage -- | Create a new textual message. By default Mandrill doesn't require you -- to specify the mmsg_text when sending out the JSON Payload, -- and this function ensure it will be present. newTextMessage :: EmailAddress -> [EmailAddress] -> Text -> Text -> MandrillMessage -- | Create a new HTML message. newHtmlMessage :: EmailAddress -> [EmailAddress] -> Text -> Html -> MandrillMessage -- | Lift a computation from the IO monad. liftIO :: MonadIO m => forall a. IO a -> m a