quartz_mailer~amberframework

A library to get started in sending and receiving emails send email receive smpte imap mailer receive-emails crystal-application quartz-mailer
0.4.0 released

Quartz-Mailer

Build Status

A library to get started in sending and receiving emails from and to your Crystal application

Installation

Add this to your application's shard.yml:

dependencies:
  quartz_mailer:
    github: amberframework/quartz-mailer

Usage

require "quartz_mailer"

The mailer has the ability to set the from, to, cc, bcc, subject and body. You may use the render helper to create the body of the email.

class WelcomeMailer < Quartz::Mailer
  def initialize
    super
    from "Amber Crystal", "info@ambercr.io"
  end

  def deliver(name: String, email: String)
    to name: name, email: email
    subject "Welcome to Amber"
    body render("mailers/welcome_mailer.slang", "mailer.slang")
    super()
  end
end

To delivery a new email:

mailer = WelcomeMailer.new
mailer.deliver(name, email)

Contributing

  1. Fork it ( https://github.com/amber-crystal/quartz-mailer/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
quartz_mailer:
  github: amberframework/quartz-mailer
  version: ~> 0.4.0
License MIT
Crystal 0.24.1

Dependencies 2

  • kilt ~> 0.4.0
    {'github' => 'jeromegn/kilt', 'version' => '~> 0.4.0'}
  • smtp~amberframework ~> 0.3.0
    {'github' => 'amberframework/smtp.cr', 'version' => '~> 0.3.0'}

Development Dependencies 1

  • expect
    {'github' => 'dukex/expect.cr'}
Last synced .
search fire star recently