Sha256: bf9d84c4d207e04197c3ce1d98d718693cc516e04494666f368110293cd54f1f

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 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
    postageapp_template   'test-template'
    postageapp_variables  'variable' => 'value'
    postageapp_uid        'custom_uid'
    postageapp_api_key    'custom_api_key'
    
    from    'test@test.test'
    subject 'Test Email'
    
    recipients ({
      'test1@test.text' => { 'name' => 'Test 1' },
      'test2@test.text' => { 'name' => 'Test 2' }
    })
  end
  
private
  
  def setup_headers
    recipients 'test@test.test'
    from       'text@test.test'
    subject    'Test Email'
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
postageapp-1.0.24 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.23 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.22 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.21 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.20 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.19 test/mailer/action_mailer_2/notifier.rb
postageapp-1.0.18 test/mailer/action_mailer_2/notifier.rb