postmark-0.2.7: Library for postmarkapp.com HTTP Api

Copyright(c) 2012 Mark Hibberd
LicenseBSD3
MaintainerMark Hibberd <mark@hibberd.id.au>
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Network.Api.Postmark

Contents

Description

Library for postmarkapp.com HTTP Api.

To get start see some examples in the Network.Api.Postmark.Tutorial module.

Source and more information can be found at https://github.com/apiengine/postmark.

To experiment with a live demo try:

$ git clone https://github.com/apiengine/postmark
$ cd postmark
$ cabal install --only-dependencies &&  cabal configure -f demo  && cabal build
$ ./dist/build/postmark-demo/postmark-demo

Issues can be reported at https://github.com/apiengine/postmark/issues.

Synopsis

Settings

type PostmarkApiToken = Text Source #

The Postmark “server token” which is sent via the X-Postmark-Server-Token HTTP header. You can find your server token under the “Credentials” tab on the Postmark website.

If you do not yet have a Postmark account, or if you want to send test emails that don't actually get delivered, you may use postmarkTestToken.

https://postmarkapp.com/developer/api/overview#authentication

postmarkHttp :: PostmarkApiToken -> PostmarkSettings Source #

Constructs Postmark settings using the HTTP protocol and your API token.

HTTPS is recommended instead (postmarkHttps).

postmarkHttps :: PostmarkApiToken -> PostmarkSettings Source #

Constructs Postmark settings using the HTTPS protocol and your API token.

Using the test token

postmarkTestToken :: PostmarkApiToken Source #

An API token that you can use when you want to send test emails that don't actually get delivered to the recipient.

https://postmarkapp.com/developer/api/overview#authentication

postmarkHttpTest :: PostmarkSettings Source #

Postmark settings using the HTTP protocol and the test API token (postmarkTestToken).

HTTPS is recommended instead (postmarkHttpsTest).

postmarkHttpsTest :: PostmarkSettings Source #

Postmark settings using the HTTPS protocol and the test API token (postmarkTestToken).

Sending email

data Email Source #

Email data type. It is recommended that you use the defaultEmail function and selector syntax to build an email, e.g.:

defaultEmail {
    emailFrom = "you@yourdomain.com"
  , emailTo = "person@example.com"
  , emailSubject = "This is an example email!"
  }
Instances
ToJSON Email Source # 
Instance details

Defined in Network.Api.Postmark.Data

Using a template

Tracking links

data TrackLinks Source #

When “link tracking” is enabled, Postmark will record statistics when a user clicks on a link in an email. You can use this feature to determine if a particular recipient has clicked a link that was emailed to them.

https://postmarkapp.com/developer/user-guide/tracking-links#enabling-link-tracking

Constructors

None

No links will be replaced or tracked.

HtmlAndText

Links will be replaced in both HTML and text bodies.

HtmlOnly

Links will be replaced in only the HTML body. You may want this option if you do not want encoded tracking links to appear in the plain text of an email.

TextOnly

Links will be replaced in only the text body.

Attachments

Response type

data Sent Source #

Instances
Eq Sent Source # 
Instance details

Defined in Network.Api.Postmark.Data

Methods

(==) :: Sent -> Sent -> Bool #

(/=) :: Sent -> Sent -> Bool #

Show Sent Source # 
Instance details

Defined in Network.Api.Postmark.Data

Methods

showsPrec :: Int -> Sent -> ShowS #

show :: Sent -> String #

showList :: [Sent] -> ShowS #

FromJSON Sent Source # 
Instance details

Defined in Network.Api.Postmark.Data

Error types

Lower-level API

Request

request :: PostmarkSettings -> PostmarkRequest e a -> IO (PostmarkResponse e a) Source #

Run the specified request with the specified settings.

Response