Sha256: e91ee7efdae6cacd6eefb50f0445683695572a506145f134711712d899084fec

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

# Test mailer for ActionMailer 2
class Notifier < PostageApp::Mailer
  
  self.template_root = File.expand_path('../', __FILE__)
  
  def blank
    # ... nothing to see here
  end
  
  def with_no_content
    setup_headers
  end
  
  def with_text_only_view
    setup_headers
  end
  
  def with_html_and_text_views
    setup_headers
  end
  
  def with_simple_view
    setup_headers
  end
  
  def with_manual_parts
    setup_headers
    part  :content_type => 'text/html',
          :body         => 'html content'
    part  :content_type => 'text/plain',
          :body         => 'text content'
    attachment  :content_type => 'image/jpeg',
                :filename     => 'foo.jpg',
                :body         => '123456789'
  end
  
  def with_body_and_attachment
    setup_headers
    attachment  :content_type => 'image/jpeg',
                :filename     => 'foo.jpg',
                :body         => '123456789'
  end
  
  def with_custom_postage_variables
    from    'test@test.test'
    subject 'Test Email'
    
    recipients ({
      'test1@test.text' => { 'name' => 'Test 1' },
      'test2@test.text' => { 'name' => 'Test 2' }
    })
    postageapp_template 'test-template'
    postageapp_variables 'variable' => 'value'
    postageapp_api_key 'custom_api_key'
  end
  
private
  
  def setup_headers
    recipients 'test@test.test'
    from       'text@test.test'
    subject    'Test Email'
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
postageapp-1.0.17 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.16 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.15 test/mailer/action_mailer_2/notifier.rb