All Projects → Swatto → motion-inappmail

Swatto / motion-inappmail

Licence: other
Wrapper for MFMailComposeViewController for RubyMotion

Programming Languages

ruby
36898 projects - #4 most used programming language

motion-inAppMail Gem Version Code Climate

This code is now part of BubbleWrap

Please don't make issues and pul requests here (this repo still exist for the past of the project)


A simple wrapper to use MFMailComposeViewController in a simple rubish way :

InAppMail.compose(self,
    {
        to: ["[email protected]","[email protected]"],
        cc: ["[email protected]"],
        cci: ["[email protected]"],
        subject: "Hi everyone !",
        message: {
            html: true,
            body: "<h1>Hi from my super iOS app !</h1>"
        }
    }) do |callback|
    if callback.sent?
        p "Email sent"
    elsif callback.canceled?
        p "Email canceled"
    elsif callback.saved?
        p "Email saved in draft"
    elsif callback.failed?
        p "Error : #{callback.error}"
    end
end

Usage

  • The first params is the view or the view controller. It's needed to push it as a modal (needed).
  • The second params is the options of your mail (secondary).
  • The third is your callback block (secondary).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].