Sha256: 6fbe1bd933e073cc5ce34ebb75bbc126a8b9af9d2d84046b7ba51d6dfaa68bb9

Contents?: true

Size: 694 Bytes

Versions: 4

Compression:

Stored size: 694 Bytes

Contents

# encoding: utf-8
class MailBuilder

  def to(receivers)
    @to = receivers
    return self
  end

  def from(sender)
    @from = "#{sender.hxt_id}@hexacta.com"
    return self
  end

  def subject(a_subject)
    @subject = a_subject
    return self
  end

  def description(a_description)
    @description = a_description
    return self
  end

  def link(a_link)
    @link = a_link
    return self
  end

  def send
    @from ||= "apps@hexacta.com"
    GeneralMail.new({ :to => @to,
                      :from => @from,
                      :subject => @subject,
                      :description => @description,
                      :link => @link
                    }).send
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sinatra-hexacta-0.3.3 lib/sinatra/extensions/mailbuilder.rb
sinatra-hexacta-0.3.2 lib/sinatra/extensions/mailbuilder.rb
sinatra-hexacta-0.3.1 lib/sinatra/extensions/mailbuilder.rb
sinatra-hexacta-0.3.0 lib/sinatra/extensions/mailbuilder.rb