ateam-merb-auth-old 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/mailers/user_mailer.rb +17 -4
- data/lib/merb-auth/adapters/common.rb +0 -1
- metadata +1 -1
data/app/mailers/user_mailer.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
22
|
+
render_utf8_mail :text => :forgot_password, :layout => nil
|
23
23
|
end
|
24
|
-
|
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(
|