Commit c5339c7681449797968d1f16a51a0fe68e3ddcfa

Authored by Daniela Feitosa
1 parent 20d51a81

sendemail_plugin: defined content_type for email

Also removed "profile" param from confirmation view and email
plugins/send_email/lib/send_email_plugin/mail.rb
@@ -35,7 +35,7 @@ class SendEmailPlugin::Mail @@ -35,7 +35,7 @@ class SendEmailPlugin::Mail
35 end 35 end
36 36
37 def params=(value = {}) 37 def params=(value = {})
38 - [:action, :controller, :to, :message, :subject, :from, :commit].each{|k| value.delete(k)} 38 + [:profile, :action, :controller, :to, :message, :subject, :from, :commit].each{|k| value.delete(k)}
39 @params = value 39 @params = value
40 end 40 end
41 41
plugins/send_email/lib/send_email_plugin/sender.rb
@@ -7,6 +7,7 @@ class SendEmailPlugin::Sender < Noosfero::Plugin::MailerBase @@ -7,6 +7,7 @@ class SendEmailPlugin::Sender < Noosfero::Plugin::MailerBase
7 @params = mail.params 7 @params = mail.params
8 8
9 mail( 9 mail(
  10 + content_type: 'text/plain',
10 to: mail.to, 11 to: mail.to,
11 from: mail.from, 12 from: mail.from,
12 subject: "[#{mail.environment.name}] #{mail.subject}" 13 subject: "[#{mail.environment.name}] #{mail.subject}"
plugins/send_email/views/send_email_plugin/sender/send_message.html.erb
1 <%= _('Contact from %s') % @referer %> 1 <%= _('Contact from %s') % @referer %>
2 2
3 <%= word_wrap(@message || @mail.message) %> 3 <%= word_wrap(@message || @mail.message) %>
  4 +
4 <% (@params || @mail.params).each_pair do |key, value| %> 5 <% (@params || @mail.params).each_pair do |key, value| %>
5 <%= key %>: <%= word_wrap(value) %> 6 <%= key %>: <%= word_wrap(value) %>
6 <% end %> 7 <% end %>