Patch #13482

Do not add empty header/footer to notification emails

Added by Anonymous over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:2.4.0

Description

Right now, even if I set the email header or footer to be empty, Redmine will still put them into the email. For HTML emails, that means you still get a line like this in the HTML code:

<span class="header"><div style="white-space: pre-wrap;"></div></span>

For plain text emails, this means you still get "-- " followed by an empty line (actually, two, but that's another story) at the end of the email. This latter point also means that if you want to disable the global footer, and tweak select mail templates to include a custom footer, this clashes.

The attached patch is quite simple: It suppress output of any header related stuff (including the span element in the HTML) part if the header is set to an empty string. Similar for the footer.

suppress-empty-header-footer.patch Magnifier (1.02 KB) Anonymous, 2013-03-15 01:30

Associated revisions

Revision 11719
Added by Toshi MARUYAMA over 4 years ago

extend mail header test to text mail (#13482)

Revision 11720
Added by Toshi MARUYAMA over 4 years ago

add mail footer test (#13482)

Revision 11721
Added by Toshi MARUYAMA over 4 years ago

not add empty header/footer to notification emails (#13482)

Contributed by Max Horn.

Revision 11722
Added by Toshi MARUYAMA over 4 years ago

fix test name (#13482)

History

#1 Updated by Anonymous over 4 years ago

It would be nice to know if the Redmine team is considering this for inclusion at all (and if so, whether / what kind of improvements are needed before this can be included), or considers it inappropriate (in which case this could be closed).

Thanks.

#2 Updated by Toshi MARUYAMA over 4 years ago

  • Status changed from New to Closed
  • Target version set to 2.4.0

Committed in trunk, thanks.

#3 Updated by Anonymous over 4 years ago

Thank you very much for this super quick reaction. I see that you also went to quite some trouble indeed, and even added some new tests for this. Thank you again for that, too!

Note: if you just had told me that I should add some tests, I would have also done that, though it would have probably taken me much longer and I am not sure if the result would have been good enough. Anyway, all I want to say is: Of course I fully understand if acceptance of a patch of mine is delayed because its quality does not meet your standards (e.g. if tests should be added) -- as long as somebody briefly tells me that, I am fully willing to work on improving my patches. But of course I won't complain if somebody else does the polishing for me, like you did.

So: Thanks yet again!

Also available in: Atom PDF