ateam-merb-auth-old 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,19 +6,32 @@ class MerbAuth::UserMailer < Merb::MailController
6
6
  @ivar = params[MA[:single_resource]]
7
7
  Merb.logger.info "Sending Signup to #{@ivar.email} with code #{@ivar.activation_code}"
8
8
  instance_variable_set("@#{MA[:single_resource]}", @ivar )
9
- render_mail :text => :signup, :layout => nil
9
+ render_utf8_mail :text => :signup, :layout => nil
10
10
  end
11
11
 
12
12
  def activation
13
13
  @ivar = params[MA[:single_resource]]
14
14
  Merb.logger.info "Sending Activation email to #{@ivar.email}"
15
15
  instance_variable_set("@#{MA[:single_resource]}", @ivar )
16
- render_mail :text => :activation, :layout => nil
16
+ render_utf8_mail :text => :activation, :layout => nil
17
17
  end
18
18
 
19
19
  def forgot_password
20
20
  @ivar = params[MA[:single_resource]]
21
21
  instance_variable_set("@#{MA[:single_resource]}", @ivar )
22
- render_mail :text => :forgot_password, :layout => nil
22
+ render_utf8_mail :text => :forgot_password, :layout => nil
23
23
  end
24
- end
24
+
25
+ private
26
+
27
+ def render_utf8_mail(options)
28
+ mail = render_mail options
29
+ mail.text = Base64.encode64(unix2dos(mail.text))
30
+ mail
31
+ end
32
+
33
+ def unix2dos(text)
34
+ text.gsub(%r{\n$|\r\n$}, "\r\n")
35
+ end
36
+
37
+ end
@@ -125,7 +125,6 @@ module MerbAuth
125
125
  return if defined?(Merb) && Merb.testing?
126
126
  from = MA[:from_email]
127
127
 
128
- params[:text] = Base64.encode64(unix2dos(params[:text]))
129
128
  params[:subject] = unix2dos(params[:subject])
130
129
 
131
130
  MA::UserMailer.dispatch_and_deliver(action, params.merge(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ateam-merb-auth-old
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ateam