Skip to content

Fix spacing above CTA button in email templates#12399

Open
officialasishkumar wants to merge 1 commit intogoogle:developfrom
officialasishkumar:fix/12344-email-cta-button-spacing
Open

Fix spacing above CTA button in email templates#12399
officialasishkumar wants to merge 1 commit intogoogle:developfrom
officialasishkumar:fix/12344-email-cta-button-spacing

Conversation

@officialasishkumar
Copy link
Copy Markdown

Summary

Addresses issue:

Relevant technical choices

The subscription-confirmation and error-email templates had a fixed 16px bottom margin on all body paragraphs, resulting in only 16px spacing above the CTA button. The invitation-email template already handled this correctly by applying 20px to the last paragraph.

This change applies the same conditional pattern from the invitation template to both affected templates:

  • Track the loop index via foreach ( $body as $index => $paragraph )
  • Use count( $body ) - 1 === $index ? '20px' : '16px' for the last paragraph's bottom margin

This ensures consistent 20px spacing above the CTA button across all three email templates while keeping the 16px spacing between intermediate paragraphs.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Apply 20px bottom margin to the last body paragraph in the
subscription-confirmation and error-email templates, matching the
invitation-email template pattern. Previously all paragraphs
used a fixed 16px margin which left insufficient space between
the body text and the CTA button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant