Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

rynkis/mailgun-crystal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailgun-crystal

send text or html by mailgun.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      mailgun-crystal:
        github: Shy07/mailgun-crystal
  2. Run shards install

Usage

require "mailgun-crystal"

client = MailgunCrystal::Client.new(
  api_key: api_key,
  domain: DOMAIN
)

res = client.send_text(
  from: "Excited User <[email protected]>",
  to: %w([email protected] YOU@YOUR_DOMAIN_NAME),
  subject: "Hello",
  content: "Testing some Mailgun awesomness!"
)

#
# => or send html
#
# res = client.send_html(
#   from: "Excited User <[email protected]>",
#   to: %w([email protected] YOU@YOUR_DOMAIN_NAME),
#   subject: "Hello",
#   content: "<h1>Testing some Mailgun awesomness!</h1>"
# )

p res # => {
      #      "status_code" => 200 if success,
      #      "id" => mailgun id if success,
      #      "message" => success message or error message
      #    }

Contributing

  1. Fork it (https://github.com/Shy07/mailgun-crystal/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

About

send text or html by mailgun.

Resources

License

Stars

Watchers

Forks

Packages

No packages published