Problem/Motivation

I encountered an issue when sending emails without a header value. Even if the header is empty, the HTML wrapper for the header is still added. This causes unwanted extra spacing under the logo, particularly when padding is applied to the header wrapper. This affects the visual layout of emails.

Steps to reproduce

When heading of the email is empty
Then having extra empty space and classes

Proposed resolution

Add a validation to check whether the header has a value before rendering the related HTML. Only include the header wrapper if there is content to display.

{% if heading %}
  <div class="postheader">
    {{ heading }}
  </div>
{% endif %}

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ✅ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-10.1.0-beta1, varbase_email-10.1.0-beta1, varbase-10.0.8, varbase_email-10.0.10

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

CommentFileSizeAuthor
#2 3542882-2.patch743 bytesodai atieh
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

odai atieh created an issue. See original summary.

odai atieh’s picture

Status: Active » Needs review
StatusFileSize
new743 bytes

Attached a patch to add extra validation.

rajab natshah’s picture

Thanks, Odai, for reporting and patching.
An MR will be merged in no time

rajab natshah’s picture

Title: Prevent extra spacing in email template when header is empty » Fix extra spacing in email template when header is empty

rajab natshah’s picture

rajab natshah’s picture

Assigned: s.halawani » Unassigned
Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-10.0.8