Sha256: 90680c8f19c5c805bcf2f7cc16a93d72b00111dc0cb2140d5efebd4e9fc7e69c

Contents?: true

Size: 641 Bytes

Versions: 99

Compression:

Stored size: 641 Bytes

Contents

# encoding: utf-8
class Mail

  def initialize(args)
    @receivers = args[:to]
    @sender = args[:from]
  end

  def template
    raise Exception, "You have to override 'template' method in #{self.class}"
  end

  def subject
    raise Exception, "You have to override 'subject' method in #{self.class}"
  end

  def values
    raise Exception, "You have to override 'values' method in #{self.class}"
  end

  def to
    _receivers = {}
    @receivers.each { |user| _receivers[user.full_name] = "Persons" }
    _receivers
  end

  def from 
    @sender ||= "apps@hexacta.com"
  end

  def send
    MailSender.perform_async(self)
  end

end

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
sinatra-hexacta-1.7.12 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.11 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.10 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.9 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.8 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.7 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.6 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.5 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.4 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.3 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.2 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.7.0 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.6.4 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.6.3 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.6.2 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.6.1 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.6.0 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.5.3 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.5.2 lib/sinatra/extensions/mail.rb
sinatra-hexacta-1.5.1 lib/sinatra/extensions/mail.rb