From 601834d74646955ad878024a8b32d35ad3ac0a56 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 4 Apr 2024 12:13:10 -0400 Subject: [PATCH] Use partial collection render for welcome mailer features (#29843) --- app/views/application/mailer/_feature.html.haml | 4 ++-- app/views/user_mailer/welcome.html.haml | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/views/application/mailer/_feature.html.haml b/app/views/application/mailer/_feature.html.haml index 5facdd0866..94dd4b9cff 100644 --- a/app/views/application/mailer/_feature.html.haml +++ b/app/views/application/mailer/_feature.html.haml @@ -4,7 +4,7 @@ %table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' } %tr %td.email-feature-td - .email-desktop-flex{ class: ('email-dir-rtl' if defined?(text_first_on_desktop) && !text_first_on_desktop) } + .email-desktop-flex{ class: ('email-dir-rtl' if feature_iteration.index.odd?) } /[if mso]
.email-desktop-column @@ -24,7 +24,7 @@ %tr %td.email-column-td - if defined?(feature) - %p{ class: ('email-desktop-text-right' if defined?(text_first_on_desktop) && text_first_on_desktop) } + %p{ class: ('email-desktop-text-right' if feature_iteration.index.even?) } = image_tag frontend_asset_url("images/mailer-new/welcome/feature_#{feature}.png"), alt: '', width: 240, height: 230 /[if mso]
diff --git a/app/views/user_mailer/welcome.html.haml b/app/views/user_mailer/welcome.html.haml index 97fb0a2c97..0f9cbf36ff 100644 --- a/app/views/user_mailer/welcome.html.haml +++ b/app/views/user_mailer/welcome.html.haml @@ -68,7 +68,4 @@ %table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' } %tr %td.email-extra-td - = render 'application/mailer/feature', feature: 'control', text_first_on_desktop: true - = render 'application/mailer/feature', feature: 'audience', text_first_on_desktop: false - = render 'application/mailer/feature', feature: 'moderation', text_first_on_desktop: true - = render 'application/mailer/feature', feature: 'creativity', text_first_on_desktop: false + = render partial: 'application/mailer/feature', collection: %w(control audience moderation creativity)