From b0634b2943352a956f802dfbbd2c672a9c7c4f9d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 6 Jan 2025 14:59:11 -0500 Subject: [PATCH] Add helpers for ios/android app store links in welcome mailer (#33475) --- app/helpers/application_helper.rb | 8 ++++++++ app/views/application/mailer/_checklist.html.haml | 4 ++-- app/views/user_mailer/welcome.text.erb | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e1ca536c7..5a5ee0553 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -238,6 +238,14 @@ module ApplicationHelper I18n.t 'user_mailer.welcome.hashtags_recent_count', people: number_with_delimiter(people), count: people end + def app_store_url_ios + 'https://apps.apple.com/app/mastodon-for-iphone-and-ipad/id1571998974' + end + + def app_store_url_android + 'https://play.google.com/store/apps/details?id=org.joinmastodon.android' + end + private def storage_host_var diff --git a/app/views/application/mailer/_checklist.html.haml b/app/views/application/mailer/_checklist.html.haml index 91c7c98f2..4b460fa26 100644 --- a/app/views/application/mailer/_checklist.html.haml +++ b/app/views/application/mailer/_checklist.html.haml @@ -29,8 +29,8 @@ %div - if defined?(show_apps_buttons) && show_apps_buttons .email-welcome-apps-btns - = link_to image_tag(frontend_asset_url('images/mailer-new/store-icons/btn-app-store.png'), alt: t('user_mailer.welcome.apps_ios_action'), width: 120, height: 40), 'https://apps.apple.com/app/mastodon-for-iphone-and-ipad/id1571998974' - = link_to image_tag(frontend_asset_url('images/mailer-new/store-icons/btn-google-play.png'), alt: t('user_mailer.welcome.apps_android_action'), width: 120, height: 40), 'https://play.google.com/store/apps/details?id=org.joinmastodon.android' + = link_to image_tag(frontend_asset_url('images/mailer-new/store-icons/btn-app-store.png'), alt: t('user_mailer.welcome.apps_ios_action'), width: 120, height: 40), app_store_url_ios + = link_to image_tag(frontend_asset_url('images/mailer-new/store-icons/btn-google-play.png'), alt: t('user_mailer.welcome.apps_android_action'), width: 120, height: 40), app_store_url_android - elsif defined?(button_text) && defined?(button_url) && defined?(checked) && !checked = render 'application/mailer/button', text: button_text, url: button_url, has_arrow: false /[if mso] diff --git a/app/views/user_mailer/welcome.text.erb b/app/views/user_mailer/welcome.text.erb index 144d44b84..383f436f8 100644 --- a/app/views/user_mailer/welcome.text.erb +++ b/app/views/user_mailer/welcome.text.erb @@ -30,8 +30,8 @@ 5. <%= t('user_mailer.welcome.apps_title') %> <%= t('user_mailer.welcome.apps_step') %> - * iOS: https://apps.apple.com/app/mastodon-for-iphone-and-ipad/id1571998974 - * Android: https://play.google.com/store/apps/details?id=org.joinmastodon.android + * iOS: <%= app_store_url_ios %> + * Android: <%= app_store_url_android %> ---