mailboxer 0.2.3 → 0.2.4

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.
@@ -17,7 +17,9 @@ class MessageMailer < ActionMailer::Base
17
17
  def new_message_email(message,receiver)
18
18
  @message = message
19
19
  @receiver = receiver
20
- mail(:to => receiver.email, :subject => "You have a new message: " + strip_tags(message.subject)) do |format|
20
+ subject = message.subject.to_s
21
+ subject = strip_tags(subject) unless subject.html_safe?
22
+ mail(:to => receiver.email, :subject => "You have a new message: " + subject) do |format|
21
23
  format.html {render __method__}
22
24
  format.text {render __method__}
23
25
  end
@@ -27,7 +29,9 @@ class MessageMailer < ActionMailer::Base
27
29
  def reply_message_email(message,receiver)
28
30
  @message = message
29
31
  @receiver = receiver
30
- mail(:to => receiver.email, :subject => "You have a new reply: " + strip_tags(message.subject)) do |format|
32
+ subject = message.subject.to_s
33
+ subject = strip_tags(subject) unless subject.html_safe?
34
+ mail(:to => receiver.email, :subject => "You have a new reply: " + subject) do |format|
31
35
  format.html {render __method__}
32
36
  format.text {render __method__}
33
37
  end
@@ -12,7 +12,9 @@ class NotificationMailer < ActionMailer::Base
12
12
  def new_notification_email(notification,receiver)
13
13
  @notification = notification
14
14
  @receiver = receiver
15
- mail(:to => receiver.email, :subject => "You have a new notification: " + strip_tags(notification.subject)) do |format|
15
+ subject = message.subject.to_s
16
+ subject = strip_tags(subject) unless subject.html_safe?
17
+ mail(:to => receiver.email, :subject => "You have a new notification: " + subject) do |format|
16
18
  format.html {render __method__}
17
19
  format.text {render __method__}
18
20
  end
@@ -4,7 +4,7 @@
4
4
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
5
  </head>
6
6
  <body>
7
- <h1>You have a new message: <%= strip_tags(@message.subject) %></h1>
7
+ <h1>You have a new message: <%= @message.subject.html_safe? ? @message.subject : strip_tags(@message.subject) %></h1>
8
8
  <p>
9
9
  You have received a new message:
10
10
  </p>
@@ -1,10 +1,10 @@
1
- You have a new message: <%= strip_tags(@message.subject) %>
1
+ You have a new message: <%= @message.subject.html_safe? ? @message.subject : strip_tags(@message.subject) %>
2
2
  ===============================================
3
3
 
4
4
  You have received a new message:
5
5
 
6
6
  -----------------------------------------------
7
- <%= strip_tags @message.body %>
7
+ <%= @message.body.html_safe? ? @message.body : strip_tags(@message.body) %>
8
8
  -----------------------------------------------
9
9
 
10
10
  Visit <%= root_url %> and go to your inbox for more info.
@@ -4,7 +4,7 @@
4
4
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
5
  </head>
6
6
  <body>
7
- <h1>You have a new reply: <%= strip_tags(@message.subject) %></h1>
7
+ <h1>You have a new reply: <%= @message.subject.html_safe? ? @message.subject : strip_tags(@message.subject) %></h1>
8
8
  <p>
9
9
  You have received a new reply:
10
10
  </p>
@@ -1,10 +1,10 @@
1
- You have a new reply: <%= strip_tags(@message.subject) %>
1
+ You have a new reply: <%= @message.subject.html_safe? ? @message.subject : strip_tags(@message.subject) %>
2
2
  ===============================================
3
3
 
4
4
  You have received a new reply:
5
5
 
6
6
  -----------------------------------------------
7
- <%= strip_tags @message.body %>
7
+ <%= @message.body.html_safe? ? @message.body : strip_tags(@message.body) %>
8
8
  -----------------------------------------------
9
9
 
10
10
  Visit <%= root_url %> and go to your inbox for more info.
@@ -4,7 +4,7 @@
4
4
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
5
  </head>
6
6
  <body>
7
- <h1>You have a new notification: <%= strip_tags(@notification.subject) %></h1>
7
+ <h1>You have a new notification: <%= @notification.subject.html_safe? ? @notification.subject : strip_tags(@notification.subject) %></h1>
8
8
  <p>
9
9
  You have received a new notification:
10
10
  </p>
@@ -1,10 +1,10 @@
1
- You have a new notification: <%= strip_tags(@notification.subject) %>
1
+ You have a new notification: <%= @notification.subject.html_safe? ? @notification.subject : strip_tags(@notification.subject) %>
2
2
  ===============================================
3
3
 
4
4
  You have received a new notification:
5
5
 
6
6
  -----------------------------------------------
7
- <%= strip_tags @notification.body %>
7
+ <%= @notification.body.html_safe? ? @notification.body : strip_tags(@notification.body) %>
8
8
  -----------------------------------------------
9
9
 
10
10
  Visit <%= root_url %> and go to your notifications for more info.
data/mailboxer.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mailboxer"
3
- s.version = "0.2.3"
3
+ s.version = "0.2.4"
4
4
  s.authors = ["Eduardo Casanova Cuesta"]
5
5
  s.summary = "Messaging system for rails apps."
6
6
  s.description = "A Rails engine that allows any model to act as messageable, permitting it interchange messages with any other messageable model." +
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailboxer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eduardo Casanova Cuesta
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-24 00:00:00 +02:00
18
+ date: 2011-07-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency