Closed Bug 1119336 Opened 11 years ago Closed 10 years ago

Add css classes to html emails, such as the comment block

Categories

(Bugzilla :: Email Notifications, enhancement)

4.5.6
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 6.0

People

(Reporter: altlist, Assigned: altlist)

Details

Attachments

(1 file, 2 obsolete files)

css classes should be added to the various sections in the html emails, such as bz_comment_text/bz_comment_head for the comment header/text. Same goes for the table. This way, one can add a bugmail-start.html.tmpl hook to define custom styling.
Attached patch v1 (obsolete) — Splinter Review
Suggested patch that add classes to the comment section and tables.
Attachment #8546129 - Flags: review?(dylan)
Comment on attachment 8546129 [details] [diff] [review] v1 Review of attachment 8546129 [details] [diff] [review]: ----------------------------------------------------------------- the patch doesn't apply to trunk.
Attachment #8546129 - Flags: review?(dylan)
Attached patch v2 (obsolete) — Splinter Review
Update patch, with some changes already deployed in bug 1142365
Attachment #8546129 - Attachment is obsolete: true
Attachment #8582575 - Flags: review?(glob)
Comment on attachment 8582575 [details] [diff] [review] v2 Review of attachment 8582575 [details] [diff] [review]: ----------------------------------------------------------------- ::: template/en/default/email/bugmail.html.tmpl~ @@ +27,4 @@ > {comment_num => comment.count, full_url => 1, user => to_user}) FILTER none %] > on [% "$terms.bug $bug.id" FILTER bug_link(bug, { full_url => 1, user => to_user }) FILTER none %] > + from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %] > + </div> you've changed this block from a <b> to a <div>. we need to retain the existing style, please revert that change. because email client have very spotty support for class-driven styles, this should remain a <b>, not <div> with a style defined elsewhere. @@ +71,5 @@ > + [% IF isnew %] > + [% class_name = "bz_new_table" %] > + [% ELSE %] > + [% class_name = "bz_diff_table" %] > + [% END %] [% class_name = isnew ? "bz_new_table" : "bz_diff_table" %]
Attachment #8582575 - Flags: review?(glob) → review-
Byron, do you suggest wrapping a <div class="xyz"> around the <b>?
(In reply to Albert Ting from comment #5) > Byron, do you suggest wrapping a <div class="xyz"> around the <b>? <b class="xyz"> the stylesheet can set a font-weight to override the weight set by <b>.
Attached patch v3Splinter Review
Updated version based on feedback in comment #4
Attachment #8582575 - Attachment is obsolete: true
Attachment #8591149 - Flags: review?(glob)
Comment on attachment 8591149 [details] [diff] [review] v3 Review of attachment 8591149 [details] [diff] [review]: ----------------------------------------------------------------- r=glob i'll fix the issues below when i commit this patch ::: template/en/default/email/bugmail.html.tmpl~ @@ +68,4 @@ > > [% BLOCK generate_diffs %] > [% SET in_table = 0 %] > + [% class_name = isnew ? "bz_new_table" : "bz_diff_table" %] nit: weird indentation @@ +93,4 @@ > [% END %] > <br> > [% IF in_table == 0 %] > + <table border="1" cellspacing="1" class="[% class_name FILTER none %]"> you cannot remove any of the existing formatting when adding classes. i'll restore cellpadding and cellspacing values on commit. @@ +105,4 @@ > > [% PROCESS "email/bugmail-common.txt.tmpl" %] > [% IF in_table == 0 %] > + <table border="1" cellspacing="1" class="[% class_name FILTER none %]"> same here
Attachment #8591149 - Flags: review?(glob) → review+
Assignee: email-notifications → altlist
Target Milestone: --- → Bugzilla 6.0
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 7b85e3b..88628a5 master -> master
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Flags: approval?
> Flags: approval? oops :)
Flags: approval? → approval+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: