Project

General

Profile

Conditional email notification content based on issue status

Added by Nico Pa 23 days ago

Hi, I'm using Redmine 6.0.5 with Puma and nginx as reverse proxy on a Ubuntu 22.04 server (see also environment info below).
I would like to include a custom message in email notifications when an issue is updated to a certain status, say "In progress".
I've tried editing these two email template files:

app/views/mailer/issue_edit.html.erb
app/views/mailer/issue_edit.text.erb
.
This is the naive code I tried including in the html template, but it doesn't have any effect. The else condition is just there for trivial debugging:
<% if @journal.private_notes? %>
  (<%= l(:field_private_notes) %>) 
<% end %>
<hr />

<% if @issue.status.name == 'In progress' %>
<p>The ticket is being processed.</p>
<% else %>
<%= @issue.status.name %>
<% end %>

<ul class="journal details">
<% details_to_strings(@journal_details, false, :only_path => false).each do |string| %>
  <li><%= string %></li>
<% end %>
</ul>

<%= textilizable(@journal, :notes, :only_path => false) %>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :user => @user, :issue_url => @issue_url } %>

Is there another way to do this? Considering that I really don't know Ruby, although I have some programming experience in other languages. Thanks.

Environment info:

Environment:
  Redmine version                6.0.5.stable
  Ruby version                   3.3.8-p144 (2025-04-09) [x86_64-linux]
  Rails version                  7.2.2.1
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Bleuclair (includes JavaScript)
SCM:
  Git                            2.34.1
  Filesystem                     
Redmine plugins:
  no plugin installed