I am having problems with the formatting of my email. This is what my code looks like ----- email NotifyMailer.create_send_notifications(@notification,@test) email.set_content_type("text/plain") NotifyMailer.deliver(email) ------- and my send_notifications.rhtml looks like this ----- <%=h @notification.message %> ----- When I send an email with quotes, for example ( test "message") my email looks like this test "message" I am running rails 1.2.3. Any help will be appreciated. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 4, 2010, at 12:48 PM, Jay Dev wrote:> I am having problems with the formatting of my email. > This is what my code looks like > > ----- > email > NotifyMailer.create_send_notifications(@notification,@test) > email.set_content_type("text/plain") > NotifyMailer.deliver(email) > ------- > > and my send_notifications.rhtml looks like this > > ----- > <%=h @notification.message %>Don''t escape it. h is an alias for html_escape which (for 2.3.2) does this on the argument: to_s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }> ----- > > When I send an email with quotes, for example ( test "message") my > email > looks like this > > test "message" > > I am running rails 1.2.3. Any help will be appreciated. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 4, 9:11 pm, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> > <%=h @notification.message %> > > Don''t escape it. h is an alias for html_escape which (for 2.3.2) does > this on the argument:To be quite precise, only use h (that is, html_escape) if the output is html. While your template is a .rhtml, you are telling mail clients that you are sending plain text. Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung wrote:> On Feb 4, 9:11�pm, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote: > >> > <%=h @notification.message %> >> >> Don''t escape it. �h is an alias for html_escape which (for 2.3.2) does � >> this on the argument: > > > To be quite precise, only use h (that is, html_escape) if the output > is html. While your template is a .rhtml, you are telling mail clients > that you are sending plain text. > > FredGreat! that worked. Thanks! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.