Skip to content

Custom brand header logo in emails

What does this MR do?

This adds the custom brand image of a gitlab instance as the header logo in the pipeline emails (pipeline_success_email and pipeline_failed_email). The gitlab logo in the email footer remains static.

I also extracted a layout from the pipeline emails. This allows for a unification of all other emails with the same email layout.

For now I only applied this to the 2 pipeline emails, but IMO it would make sense to use this new layout for all other emails as well, and therefore allow the use of the custom brand image for all emails.

Possible further work I could put into this MR

  • Change the admin section title from "Navigation bar:" to something more general as "Custom branding:"

Possible further work I could put into a separate MR

  • Apply the same email layout to all emails. Currently there are at least 3 different email styles:
    • Pipeline emails (which now use app/views/layouts/mailer{html.haml,text.haml})
    • All notify emails except the 2 pipeline ones use app/views/layouts/notify.html.haml
    • All devise emails use app/views/layouts/devise_mailer.html.haml
  • Extract the inline styles from app/views/layouts/mailer{html.haml,text.haml} and the pipeline emails and solve the premailer problems mentioned in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6019 and make them available to all other emails.

To illustrate the update of all mails I updated the app/views/devise/mailer/password_change.html.haml template with the extracted new mailer layout. This shows how minimal the updates could be as a first step towards updating and unifying all emails. (not in this MR included)

%tr
  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#333333;font-size:15px;font-weight:400;line-height:1.4;padding:15px 5px;text-align:center;" }
    Hello, #{@resource.name}!
    %p
      The password for your GitLab account on
      #{link_to(Gitlab.config.gitlab.url, Gitlab.config.gitlab.url)}
      has successfully been changed.
    %p
      If you did not initiate this change, please contact your administrator
      immediately.

PNG_Image__747___469_pixels

The development of this MR is sponsored by @siemens (/cc @bufferoverflow).

Why was this MR needed?

The brand logo helps the users to identify the emails as they now use the same header logo as the gitlab instance.

Screenshots

custom_brand_email

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24969

May partially fix https://gitlab.com/gitlab-org/gitlab-ce/issues/25570

Relates to (regarding unifying of mail templates) https://gitlab.com/gitlab-org/gitlab-ce/issues/25572

Merge request reports

Loading