diff --git a/app/controllers/admin/announcements_controller.rb b/app/controllers/admin/announcements_controller.rb index cdabadb..89b1f06 100644 --- a/app/controllers/admin/announcements_controller.rb +++ b/app/controllers/admin/announcements_controller.rb @@ -336,6 +336,7 @@ class Admin::AnnouncementsController < OrbitAdminController if bulletin.email.nil? email = Email.new email.save + email.deliver rescue nil bulletin.email_id = email.id bulletin.save end diff --git a/app/helpers/admin/announcements_helper.rb b/app/helpers/admin/announcements_helper.rb index a174cb9..847dd10 100644 --- a/app/helpers/admin/announcements_helper.rb +++ b/app/helpers/admin/announcements_helper.rb @@ -127,6 +127,7 @@ module Admin::AnnouncementsHelper url = "http://#{request.host_with_port}/admin/announcements/#{announcement.id}/edit" datatosend = "
#{current_user.name} #{t("announcement.rejected_annoucement")} : #{announcement.rejection_reason} #{t("announcement.click_here_to_see")}
" mail = Email.new(:mail_to => email, :mail_subject => "Announcement rejected公告未通過 : #{announcement.title}.", :template => "email/announcement_email.html.erb", :template_data => {"html" => datatosend}) + mail.save mail.deliver rescue nil end end @@ -170,6 +171,7 @@ module Admin::AnnouncementsHelper datatosend = "#{t("announcement.updated_annoucement", :poster => current_user.name)}
#{t("announcement.approval_announcement_title")} : #{announcement.title}
#{t("announcement.click_here_to_see")} : #{url}