Sha256: 24119f84ab872f1b808e5379cf55827a317da5baed22c540fdb08535155c55e5

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

# -*- coding: utf-8 -*-
require 'jpmobile/mail'

module Jpmobile
  module Mailer
    class Base < ActionMailer::Base
      def mail(headers={}, &block)
        m = super(headers, &block)

        if m.to.size == 1
          # for mobile
          m.mobile = (Jpmobile::Email.detect(m.to.first) || Jpmobile::Mobile::AbstractMobile).new(nil, nil)
        else
          # for multi to addresses
          m.mobile = Jpmobile::Mobile::AbstractMobile.new(nil, nil)
        end

        m
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jpmobile-0.1.6 test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_mailer.rb