message send email
This commit is contained in:
parent
dcc47ae989
commit
10177618f0
|
@ -1,7 +1,7 @@
|
||||||
# Added by young
|
# Added by young
|
||||||
class JournalsForMessageObserver < ActiveRecord::Observer
|
class JournalsForMessageObserver < ActiveRecord::Observer
|
||||||
def after_create(journal_for_message)
|
def after_create(journals_for_message)
|
||||||
Mailer.journals_for_message_add(User.current, journal_for_message).deliver
|
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,14 @@ class Mailer < ActionMailer::Base
|
||||||
|
|
||||||
# Builds a Mail::Message object used to email recipients of the added journals for message.
|
# Builds a Mail::Message object used to email recipients of the added journals for message.
|
||||||
#
|
#
|
||||||
# def journals_for_message_add(user, journals_for_message)
|
def journals_for_message_add(user, journals_for_message)
|
||||||
# @user = User.current
|
@user = User.current
|
||||||
# @url = url_for(:controller => 'users', :action => 'user_newfeedback')
|
@mail = journals_for_message.jour
|
||||||
# mail :to => user.mail,
|
@message = journals_for_message.notes
|
||||||
# :subject => "hello"
|
@url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => @mail)
|
||||||
# end
|
mail :to => @mail.mail,
|
||||||
|
:subject => "You have a new message"
|
||||||
|
end
|
||||||
|
|
||||||
# Builds a Mail::Message object used to email recipients of the added issue.
|
# Builds a Mail::Message object used to email recipients of the added issue.
|
||||||
#
|
#
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<h1><%= link_to("hello", @url) %></h1>
|
||||||
|
<em><%=h @user %></em>
|
||||||
|
<div><%= @message %></div>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<%= link_to("hello", @url) %>
|
||||||
|
<%=h @user %>
|
||||||
|
<%= @message %>
|
|
@ -23,7 +23,7 @@ module RedmineApp
|
||||||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||||
|
|
||||||
# Activate observers that should always be running.
|
# Activate observers that should always be running.
|
||||||
config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
|
config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
|
||||||
|
|
||||||
config.active_record.store_full_sti_class = true
|
config.active_record.store_full_sti_class = true
|
||||||
config.active_record.default_timezone = :local
|
config.active_record.default_timezone = :local
|
||||||
|
|
Loading…
Reference in New Issue