Latest 1.0.3
Homepage https://github.com/limadeveloper/SWMailgun
License MIT
Platforms ios 9.3, requires ARC
Dependencies BaseNetworkKit
Authors

GitHub release
Build Status
CocoaPods
GitHub repo size
License
Platform

SWMailgun provides a simple alternative when you need to send an email with your iOS app using MailGun.

❓ Why

Sometimes, there is the need to setup a simple email form in your iOS app, or to 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.

✉️ Mailgun

Mailgun provides a simple reliable API for transactional emails. You will need to have an ApiKey and an account to use the client.

❗️ Requirements

  • iOS 9.3+
  • Swift 4.1+

⚒ Installation

CocoaPods

SWMailgun is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SWMailgun', '~> 1.0'

and run pod install

🎓 How to use

Usage is very simple

import SWMailgun

let service = MailgunService()
let html = "<b>Test</b>"

let email = MailgunEmail(
    from: "Excited User <[email protected]>",
    to: "[email protected]",
    subject: "This is a test",
    html: html,
    text: html.htmlToString
)

let auth = MailgunAuth(
    domain: "YOUR_DOMAIN",
    apiKey: "YOUR_API_KEY"
)

service.send(email: email, auth: auth) { result, error in
    guard let result = result else {
        print("Error: (error)")
        return
    }
    print("Email was sent: (result.success)")
}

If you need more examples, open demo project.

🙋🏻‍♂️ Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request. 👨🏻‍💻

📜 License

SWMailgun is under MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SWMailgun",
    "version": "1.0.3",
    "summary": "u2709ufe0f SWMailgun provides simple alternative APIs when you need to send an email with your iOS app using Mailgun",
    "requires_arc": true,
    "homepage": "https://github.com/limadeveloper/SWMailgun",
    "license": "MIT",
    "authors": {
        "John Lima": "[email protected]"
    },
    "social_media_url": "https://twitter.com/thejohnlima",
    "platforms": {
        "ios": "9.3"
    },
    "source": {
        "git": "https://github.com/limadeveloper/SWMailgun.git",
        "tag": "1.0.3"
    },
    "source_files": "Framework/SWMailgun/Source/**/*.{swift}",
    "swift_versions": "4.1",
    "dependencies": {
        "BaseNetworkKit": []
    },
    "swift_version": "4.1"
}

Pin It on Pinterest

Share This