Feature #39723 ยป add-assigned_to_you-tag-in-email-subjects .patch
| app/models/mailer.rb | ||
|---|---|---|
|
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
|
||
|
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]"
|
||
|
subject += " (#{issue.status.name})" if Setting.show_status_changes_in_mail_subject?
|
||
|
subject += " (#{I18n.t('label_assigned_to_you')})" if issue.assigned_to == user && Setting.show_assigned_to_you_in_mail_subject?
|
||
|
subject += " #{issue.subject}"
|
||
|
mail :to => user,
|
||
|
:subject => subject
|
||
| ... | ... | |
|
@author = journal.user
|
||
|
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
|
||
|
s += "(#{issue.status.name}) " if journal.new_value_for('status_id') && Setting.show_status_changes_in_mail_subject?
|
||
|
s += "(#{I18n.t('label_assigned_to_you')}) " if issue.assigned_to == user && Setting.show_assigned_to_you_in_mail_subject?
|
||
|
s += issue.subject
|
||
|
@issue = issue
|
||
|
@user = user
|
||
| app/views/settings/_notifications.html.erb | ||
|---|---|---|
|
<p><%= setting_check_box :plain_text_mail %></p>
|
||
|
<p><%= setting_check_box :show_status_changes_in_mail_subject %></p>
|
||
|
<p><%= setting_check_box :show_assigned_to_you_in_mail_subject %></p>
|
||
|
</div>
|
||
|
<fieldset class="box" id="notified_events"><legend><%=l(:text_select_mail_notifications)%></legend>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
setting_timelog_max_hours_per_day: Maximum hours that can be logged per day and user
|
||
|
setting_timelog_accept_future_dates: Accept time logs on future dates
|
||
|
setting_show_status_changes_in_mail_subject: Show status changes in issue mail notifications subject
|
||
|
setting_show_assigned_to_you_in_mail_subject: Show issue assigned to you in issue mail notifications subject
|
||
|
setting_project_list_defaults: Projects list defaults
|
||
|
setting_twofa: Two-factor authentication
|
||
| ... | ... | |
|
label_display_type_board: Board
|
||
|
label_my_bookmarks: My bookmarks
|
||
|
label_assign_to_me: Assign to me
|
||
|
label_assigned_to_you: Assigned to you
|
||
|
label_default_query: Default query
|
||
|
label_edited: Edited
|
||
|
label_time_by_author: "%{time} by %{author}"
|
||
| config/settings.yml | ||
|---|---|---|
|
default: 1
|
||
|
show_status_changes_in_mail_subject:
|
||
|
default: 1
|
||
|
show_assigned_to_you_in_mail_subject:
|
||
|
default: ''
|
||
| test/unit/mailer_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_issue_add_subject_should_include_assigned_to_you_if_setting_show_assigned_to_you_in_mail_subject_is_enabled
|
||
|
with_settings :show_assigned_to_you_in_mail_subject => 1 do
|
||
|
issue = Issue.find(2)
|
||
|
assert assignee = issue.assigned_to
|
||
|
Mailer.deliver_issue_add(issue)
|
||
|
assert mail = ActionMailer::Base.deliveries.find {|m| m.to.include?(assignee.mail)}
|
||
|
assert_equal "[eCookbook - Feature request #2] (Assigned) (Assigned to you) Add ingredients categories", mail.subject
|
||
|
end
|
||
|
end
|
||
|
def test_issue_add_subject_should_not_include_assigned_to_you_if_setting_show_assigned_to_you_in_mail_subject_is_disabled
|
||
|
with_settings :show_assigned_to_you_in_mail_subject => 0 do
|
||
|
issue = Issue.find(2)
|
||
|
assert assignee = issue.assigned_to
|
||
|
Mailer.deliver_issue_add(issue)
|
||
|
assert mail = ActionMailer::Base.deliveries.find {|m| m.to.include?(assignee.mail)}
|
||
|
assert_equal "[eCookbook - Feature request #2] (Assigned) Add ingredients categories", mail.subject
|
||
|
end
|
||
|
end
|
||
|
def test_issue_add_should_include_issue_status_type_badge
|
||
|
issue = Issue.find(1)
|
||
|
Mailer.deliver_issue_add(issue)
|
||