Project

General

Profile

How to get a project's custom field value from mailer.rb

Added by Jonathan Vargas almost 12 years ago

Hi,

I am trying to customize the subject of the email notifications by using a "shortname" custom field I've defined for projects.

How can I get and render this value from mailer.rb model?

:subject => "[#{issue.project.custom_field_values(0).value}

But it doesnt work.

How could I do it?


Replies (3)

RE: How to get a project's custom field value from mailer.rb - Added by Nikolay Ruban about 10 years ago

custom_field_values points to array, so square pracet should be used

:subject => "[#{issue.project.custom_field_values[0].value}

RE: How to get a project's custom field value from mailer.rb - Added by Charles So over 9 years ago

Great, that works!

If I want to use the same field in Return-Path, can you advise how to do this? Change mail.rb, or other files?

    (1-3/3)