Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamthehutt/69717 to your computer and use it in GitHub Desktop.
Save adamthehutt/69717 to your computer and use it in GitHub Desktop.

FracturedAtlas.org API: Email Sending

Overview

  • To use the API, you’ll first need an API Key.

Methods

send

  • Accepts a POST request at http://www.fracturedatlas.org/api/API_KEY_GOES_HERE/Mailer/send
  • Mandatory parameters
    • to One or more “To” recipients. Send multiple recipients by using PHP array syntax, e.g.,
      • to[] => guy@example.com
      • to[] => anotherguy@example.com
    • from Email address for the “From” header.
    • subject Subject line
  • Optional parameters
    • body[text] Plain text body of the email
    • body[html] HTML body of the email
    • headers[N] 0-N arbitrary headers, defined as in the following example:
      • headers[0][header] => X-Foo
      • headers[0][value] => Bar
      • headers[1][header] => Reply-to
      • headers[1][value] => me@mysite.com
      • headers[2][header] => Return-path
      • headers[2][value] => bouncebin@mysite.com
    • attachments[N] 0-N attachments, defined as in the following example:
      • attachments[0][file] => THE_CONTENTS_OF_THE_FILE
      • attachments[0][name] => Document.pdf
      • attachments[0][mimetype] => application/pdf
      • attachments[1][file] => THE_CONTENTS_OF_ANOTHER_FILE
      • attachments[1][name] => Numbers.xls
      • attachments[1][mimetype] => application/x-excel

Response Formats

  • php – a serialized associative array (default)
  • json

Sample send responses (in JSON format)

  
    {"status":"error","message":"Unsuccessful send attempt"}

    {"status":"success", "message":"Email sent"}
  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment