Commit 05d537e3590b3ce92baec5d0a6a977f4198bebe5
Committed by
Tallys Martins
1 parent
6ef3eef0
Exists in
master
and in
29 other branches
Inserted message body into Work Assignment email notification
TODO Refactor send_email method on Work Assignment Cms controller Signed-off-by: Hebert Douglas <hebertdougl@gmail.com> Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
Showing
4 changed files
with
28 additions
and
1 deletions
Show diff stats
plugins/work_assignment/controllers/myprofile/work_assignment_plugin_cms_controller.rb
... | ... | @@ -92,4 +92,29 @@ class WorkAssignmentPluginCmsController < CmsController |
92 | 92 | redirect_to referer |
93 | 93 | end |
94 | 94 | end |
95 | + | |
96 | +#TODO | |
97 | +#Refatorar o método send_email para utilizar o build_mail_message para inserir o link dos arquivos | |
98 | +=begin | |
99 | + def build_mail_message | |
100 | + @files_paths = [] | |
101 | + @files_string = params[:self_files_id] | |
102 | + @files_id_list = @files_string.split(' ') | |
103 | + | |
104 | + @files_id_list.each do |file_id| | |
105 | + @file = environment.articles.find_by_id(file_id) | |
106 | + @real_file_url = "http://#{@file.url[:host]}:#{@file.url[:port]}/#{@file.url[:profile]}/#{@file.path}" | |
107 | + @files_paths << @real_file_url | |
108 | + unless params[:email_contact][:message].include? "#{@real_file_url}" | |
109 | + params[:email_contact][:message] += "<br> Clique <a href='#{@real_file_url}'>aqui</a> para acessar o arquivo ou acesse pela URL: <br>" | |
110 | + params[:email_contact][:message] += "<br><a href='#{@real_file_url}'>#{@real_file_url}</a>" | |
111 | + end | |
112 | + end | |
113 | + @message = "AVISO: O aluno deve imprimir este email e entrega-lo na secretaria como comprovante do envio!" | |
114 | + unless params[:email_contact][:message].include? "#{@message}" | |
115 | + params[:email_contact][:message] += "<br><br>#{@message}" | |
116 | + end | |
117 | + end | |
118 | +=end | |
119 | + | |
95 | 120 | end |
96 | 121 | \ No newline at end of file | ... | ... |
plugins/work_assignment/lib/ext/email_contact.rb
plugins/work_assignment/lib/work_assignment_plugin.rb
plugins/work_assignment/views/work_assignment_plugin_cms/_work_assignment_form.html.erb
1 | 1 | <% form_for('uploaded_file', :url => { :controller => 'work_assignment_plugin_cms', :action => 'upload_files' }, :html => {:multipart => true}) do |f| %> |
2 | 2 | <%= render :partial => 'notify_checkbox', :locals => { :size => '45'} %> |
3 | 3 | <%= render :partial => 'upload_file_form', :locals => { :size => '45'} %> |
4 | - x | |
4 | + | |
5 | 5 | <% end %> |
6 | 6 | \ No newline at end of file | ... | ... |