Improve payment mails

Authorization required mail (to shop): Add order summary table to email.

Authorize payment email (to customer): Add order summary table to email.

The order summary tables require the checkout_helper in the payment_mailer.rb.

Add 'Order summary' string to shared strings, because this will be needed in the order placement mailer for subscriptions as well (instead of 'Order confirmation').

The rest are styling and wording improvements.
This commit is contained in:
drummer83
2024-02-18 17:09:57 +01:00
parent 4727e94eba
commit f46e284ef0
4 changed files with 29 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
class PaymentMailer < ApplicationMailer
include I18nHelper
helper MailerHelper
helper 'checkout'
def authorize_payment(payment)
@payment = payment

View File

@@ -11,7 +11,16 @@
%p
= t(".instructions")
%p
= link_to spree.edit_admin_order_url(@payment.order), spree.edit_admin_order_url(@payment.order)
%p.callout
= t(".view_order")
%br
%strong
= link_to t(".link_label"), spree.edit_admin_order_url(@payment.order)
%h3
= t('mailers_shared.order_summary_html', number: @order.number)
= render 'shared/mailers/order_summary'
= render 'shared/mailers/signoff_instance'

View File

@@ -9,8 +9,17 @@
intro: t(intro_key, distributor: @payment.order.distributor.name, amount: @payment.display_amount),
enterprise_for_logo: @enterprise_for_logo }
%p.callout
= t('.click_link')
%br
%strong
= link_to t('.link_label'), main_app.authorize_payment_url(@payment)
%h3
= t('mailers_shared.order_summary_html', number: @order.number)
%p
= t(".instructions")
= link_to main_app.authorize_payment_url(@payment), main_app.authorize_payment_url(@payment)
= t('.details_html', distributor: @order.distributor.name)
= render 'shared/mailers/order_summary'
= render 'shared/mailers/signoff_distributor'

View File

@@ -382,6 +382,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
enterprise_greeting: "Dear %{name},"
general_greeting: "Hello!"
order_confirmation_html: "Order confirmation <strong>#%{number}</strong>"
order_summary_html: "Order summary <strong>#%{number}</strong>"
enterprise_mailer:
confirmation_instructions:
subject: "Please confirm the email address for %{enterprise}" # I don't think this is ever used, because 'confirmation_instructions' is part of user_mailer and has a different subject defined.
@@ -405,11 +406,15 @@ See the %{link} to find out more about %{sitename}'s features and to start using
authorize_payment:
subject: "Please authorize your payment for order %{number} at %{distributor}"
intro_html: "Your payment of <strong>%{amount}</strong> to <strong>%{distributor}</strong> requires additional authentication."
instructions: "Please visit the following URL to authorize your payment:"
click_link: "Please click the link below to authorize your payment:"
link_label: "Authorize payment »"
details_html: "Here are the details of your order for <strong>%{distributor}</strong>:"
authorization_required:
subject: "Authentication from customer required for payment of order %{number} at %{distributor}"
intro_html: "A payment for order <strong>%{order_number}</strong> at <strong>%{distributor}</strong> requires additional authorization from the customer."
instructions: "The customer has been notified via email and the payment will appear as pending until it is authorized."
view_order: "To view the order click the link below."
link_label: "View order »"
producer_mailer:
order_cycle_report:
subject: "Order cycle report from %{coordinator} for %{producer}"