diff --git a/controllers/email_article_plugin_myprofile_controller.rb b/controllers/email_article_plugin_myprofile_controller.rb index ad3154d..fd4233f 100644 --- a/controllers/email_article_plugin_myprofile_controller.rb +++ b/controllers/email_article_plugin_myprofile_controller.rb @@ -4,26 +4,16 @@ class EmailArticlePluginMyprofileController < MyProfileController # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add] # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail] # before_filter :login_required, :only => [:add, :join, :join_not_logged, :leave, :unblock, :leave_scrap, :remove_scrap, :remove_activity, :view_more_activities, :view_more_network_activities, :report_abuse, :register_report, :leave_comment_on_activity, :send_mail] - -# self.members - - def send_email - puts "ID ***************************" - y params[:id] - puts "END ID ***************************" +# puts "ID ***************************" +# y params[:id] +# puts "END ID ***************************" profile = Profile[params[:profile]] article = Article.find(params[:id]) - session[:notice] = 'Tudo beleza' EmailArticlePluginMyprofileController::Sender.deliver_mail(article) -# -# puts "########################params[:mailing]########################" -# y params[:mailing] -# raise -# end @@ -49,7 +39,6 @@ class EmailArticlePluginMyprofileController < MyProfileController # end subject "[Artigo] " + article.title body article.body - end end diff --git a/lib/email_article_plugin.rb b/lib/email_article_plugin.rb index ce14775..5039b3e 100644 --- a/lib/email_article_plugin.rb +++ b/lib/email_article_plugin.rb @@ -12,7 +12,9 @@ class EmailArticlePlugin < Noosfero::Plugin lambda { link_to_remote(_("Email article to members"), {:url => { :controller => 'email_article_plugin_myprofile', :action => "send_email", :id => @page}, - :method => :get + :method => :get, + :success => "alert('Emails enviados')", + :failure => "alert('Erro ao enviar email')" # , :loading => "Enviando emails" }) } -- libgit2 0.21.2