diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb index 3bca4779..f0dce08c 100644 --- a/app/models/journals_for_message_observer.rb +++ b/app/models/journals_for_message_observer.rb @@ -1,7 +1,7 @@ # Added by young class JournalsForMessageObserver < ActiveRecord::Observer - def after_create(journal_for_message) - Mailer.journals_for_message_add(User.current, journal_for_message).deliver + def after_create(journals_for_message) + Mailer.journals_for_message_add(User.current, journals_for_message).deliver end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index ed942f0d..5f71ce45 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -29,12 +29,14 @@ class Mailer < ActionMailer::Base # Builds a Mail::Message object used to email recipients of the added journals for message. # - # def journals_for_message_add(user, journals_for_message) - # @user = User.current - # @url = url_for(:controller => 'users', :action => 'user_newfeedback') - # mail :to => user.mail, - # :subject => "hello" - # end + def journals_for_message_add(user, journals_for_message) + @user = User.current + @mail = journals_for_message.jour + @message = journals_for_message.notes + @url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => @mail) + mail :to => @mail.mail, + :subject => "You have a new message" + end # Builds a Mail::Message object used to email recipients of the added issue. # diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb new file mode 100644 index 00000000..cef20b5c --- /dev/null +++ b/app/views/mailer/journals_for_message_add.html.erb @@ -0,0 +1,3 @@ +