Correctly style system header and footer in emails
Context
The following discussion from !108303 (merged) should be addressed:
-
@pslaughter started a discussion: (+4 comments) issue (ux,non-blocking): It looks like we're not rendering the color and style of these headers and footers:
Here's a patch for this which would be nice to handle in a separate MR. @htroian-ext would you be up for creating this other MR?
Patch
diff --git a/app/assets/stylesheets/notify_base.scss b/app/assets/stylesheets/notify_base.scss index 0ca1398c6093..47907c33de2c 100644 --- a/app/assets/stylesheets/notify_base.scss +++ b/app/assets/stylesheets/notify_base.scss @@ -24,3 +24,14 @@ pre.commit-message { .content { @include email-code-block; } + +.header-message, +.footer-message { + text-align: center; + margin: 0; + + p { + font-size: $gl-font-size-small; + margin: 0; + } +} diff --git a/app/helpers/emails_helper.rb b/app/helpers/emails_helper.rb index f6de405cecb6..c5ba2253862c 100644 --- a/app/helpers/emails_helper.rb +++ b/app/helpers/emails_helper.rb @@ -157,13 +157,13 @@ def create_list_id_string(project, list_id_max_length = 255) def html_header_message return unless show_header? - render_message(:header_message, style: '') + render_message(:header_message) end def html_footer_message return unless show_footer? - render_message(:footer_message, style: '') + render_message(:footer_message) end def text_header_message
FYI - @danmh based on this discussion in the other thread.
These need to match the colors set in the GitLab instance settings. Having some experience in an organization that used system headers and footers, the color is important and needs to be respected. Check out the
Screenshot after applying patch
I added above for how I'd expect these headers to look.
Edited by Dan MH