lib/jpmobile/mailer.rb in jpmobile-1.0.12 vs lib/jpmobile/mailer.rb in jpmobile-2.0.0.pre.1
- old
+ new
@@ -9,30 +9,24 @@
class Base < ActionMailer::Base
self._view_paths = self._view_paths.dup
self.view_paths.unshift(Jpmobile::Resolver.new(File.join(::Rails.root, "app/views")))
def mail(headers={}, &block)
- tos = headers[:to] || self.default_params[:to]
- tos = tos.split(/,/)
+ tos = headers[:to].split(/,/)
@mobile = if tos.size == 1
# for mobile
(Jpmobile::Email.detect(tos.first) || Jpmobile::Mobile::AbstractMobile).new(nil, nil)
else
# for multi to addresses
Jpmobile::Mobile::AbstractMobile.new(nil, nil)
end
self.lookup_context.mobile = @mobile.variants
- @mobile.decorated = headers.delete(:decorated)
-
m = super(headers, &block)
m.mobile = @mobile
m.charset = @mobile.mail_charset
-
- # for decorated-mail manipulation
- m.rearrange! if @mobile.decorated?
m
end
class << self