[noosfero/noosfero][master] sendemail_plugin: defined content_type for email

Daniela Feitosa gitlab at gitlab.com
Tue Apr 14 23:29:53 BRT 2015


Daniela Feitosa pushed to master at Noosfero / noosfero


Commits:
c5339c76 by Daniela Feitosa at 2015-04-14T23:18:06Z
sendemail_plugin: defined content_type for email

Also removed "profile" param from confirmation view and email

- - - - -


3 changed files:

- plugins/send_email/lib/send_email_plugin/mail.rb
- plugins/send_email/lib/send_email_plugin/sender.rb
- plugins/send_email/views/send_email_plugin/sender/send_message.html.erb


Changes:

=====================================
plugins/send_email/lib/send_email_plugin/mail.rb
=====================================
--- a/plugins/send_email/lib/send_email_plugin/mail.rb
+++ b/plugins/send_email/lib/send_email_plugin/mail.rb
@@ -35,7 +35,7 @@ class SendEmailPlugin::Mail
   end
 
   def params=(value = {})
-    [:action, :controller, :to, :message, :subject, :from, :commit].each{|k| value.delete(k)}
+    [:profile, :action, :controller, :to, :message, :subject, :from, :commit].each{|k| value.delete(k)}
     @params = value
   end
 

=====================================
plugins/send_email/lib/send_email_plugin/sender.rb
=====================================
--- a/plugins/send_email/lib/send_email_plugin/sender.rb
+++ b/plugins/send_email/lib/send_email_plugin/sender.rb
@@ -7,6 +7,7 @@ class SendEmailPlugin::Sender < Noosfero::Plugin::MailerBase
     @params = mail.params
 
     mail(
+      content_type: 'text/plain',
       to: mail.to,
       from: mail.from,
       subject: "[#{mail.environment.name}] #{mail.subject}"

=====================================
plugins/send_email/views/send_email_plugin/sender/send_message.html.erb
=====================================
--- a/plugins/send_email/views/send_email_plugin/sender/send_message.html.erb
+++ b/plugins/send_email/views/send_email_plugin/sender/send_message.html.erb
@@ -1,6 +1,7 @@
 <%= _('Contact from %s') % @referer %>
 
 <%= word_wrap(@message || @mail.message) %>
+
 <% (@params || @mail.params).each_pair do |key, value| %>
 <%= key %>: <%= word_wrap(value) %>
 <% end %>


View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/c5339c7681449797968d1f16a51a0fe68e3ddcfa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150415/cda24824/attachment.html>


More information about the Noosfero-dev mailing list