Latest 1.0.4
Homepage https://github.com/PiXeL16/SwiftMandrill
License MIT
Platforms ios 8.0, requires ARC
Dependencies ObjectMapper, Alamofire
Authors

SwiftMandrill Build Status codecov.io Cocoapods Compatible GitHub license

SwiftMandrill provides simple alternative when you need to send an email with your iOS app.
question: Why?
—-
Sometimes, there is the need to setup a simple email form in your iOS app, or trigger an email after an action, without having to setup your own service for that, sometimes you don’t want to use the MailComposeViewController or use a SMTP library.
This provide a simple alternative when you need to send an email with your iOS app.

monkey: Mandrill

Mandrill provides a simple reliable API for transactional emails. You will need to have a Mandrill account to use the client and a API key.

octocat: Installation

Get SwiftMandrill on CocoaPods, just add pod 'SwiftMandrill' to your Podfile.

mortar_board: Usage

Usage is very simple

let api = MandrillAPI(ApiKey: "YourApiKey")

api.sendEmail(from:    "[email protected]",
              fromName:"Chris Jimenez",
              to:      "[email protected]",
              subject: "My subject",
              html:    "<b>This is a Test</b>",
              text:    "This is a test"){ mandrillResult in
    if mandrillResult.success {
      print("Email was sent!")
    }
}

You can also send an email to several recipients by passing an array

let api = MandrillAPI(ApiKey: "YourApiKey")

api.sendEmail(from:    "[email protected]",
              fromName:"Chris Jimenez",
              to:      ["[email protected]","[email protected]"],
              subject: "My subject",
              html:    "<b>This is a Test</b>",
              text:    "This is a test"){ mandrillResult in
    if mandrillResult.success {
      print("Email was sent!")
    }
}

If inline parameters is not your thing you can also provide a MandrillEmail object and send that one

let api = MandrillAPI(ApiKey: "YourApiKey")

let email     = MandrillEmail()
email.from    = "[email protected]"
email.fromName= "Chris Jimenez"
email.to      = "[email protected]"
email.subject = "this is a test"
email.html    = "<b><Test/b>"
email.text    = "Test"   

 api.sendEmail(withEmail: email){ mandrillResult in
    if mandrillResult.success {
      print("Email was sent!"")
    }
}

:wrench: TODO

  • Most of the API is still not cover, stuff like tracking, templates, search, etc will be a nice addition.

  • Carthage support

:v: License

MIT

alien: Author

Chris Jimenez – http://chrisjimenez.net, @chrisjimeneznat

Latest podspec

{
    "name": "SwiftMandrill",
    "version": "1.0.4",
    "summary": "A simple iOS client for the Mandrill Mail API",
    "description": "SwiftMandrill provides simple alternative when you need to send an email with your iOS app.",
    "homepage": "https://github.com/PiXeL16/SwiftMandrill",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Jimenez": "[email protected]"
    },
    "social_media_url": "http://twitter.com/chrisjimeneznat",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/PiXeL16/SwiftMandrill.git",
        "tag": "1.0.4"
    },
    "source_files": [
        "SwiftMandrill/",
        "SwiftMandrill/**/*.{h,m,swift}"
    ],
    "requires_arc": true,
    "dependencies": {
        "ObjectMapper": [
            "~> 1.1"
        ],
        "Alamofire": [
            "~> 3.0"
        ]
    }
}

Pin It on Pinterest

Share This