Add signoff to all remaining emails which didn't have one yet

To do so the shipment mailer and payment mailers need to know the @order

Remove the 'callout' class from distributor signoff for uniformity and to keep the callout available for call to actions only

Remaining translation keys for emails will be re-organized in a separate commit
This commit is contained in:
drummer83
2024-01-21 21:45:27 +01:00
parent 64fed25d9d
commit a84a16dd69
9 changed files with 15 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ class PaymentMailer < ApplicationMailer
def authorize_payment(payment)
@payment = payment
@order = @payment.order
@hide_ofn_navigation = @payment.order.distributor.hide_ofn_navigation
subject = I18n.t('spree.payment_mailer.authorize_payment.subject',
distributor: @payment.order.distributor.name)
@@ -16,6 +17,7 @@ class PaymentMailer < ApplicationMailer
def authorization_required(payment)
@payment = payment
@order = @payment.order
shop_owner = @payment.order.distributor.owner
subject = I18n.t('spree.payment_mailer.authorization_required.subject',
order: @payment.order)

View File

@@ -6,6 +6,7 @@ module Spree
def shipped_email(shipment, delivery:)
@shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment)
@order = @shipment.order
@hide_ofn_navigation = @shipment.order.distributor.hide_ofn_navigation
@delivery = delivery
subject = base_subject

View File

@@ -13,3 +13,5 @@
= t(".instructions")
%p
= link_to spree.edit_admin_order_url(@payment.order), spree.edit_admin_order_url(@payment.order)
= render 'shared/mailers/signoff_instance'

View File

@@ -12,3 +12,5 @@
%p
= t(".instructions")
= link_to main_app.authorize_payment_url(@payment), main_app.authorize_payment_url(@payment)
= render 'shared/mailers/signoff_distributor'

View File

@@ -9,3 +9,5 @@
= t(".message")
%ul
%li= link_to(t(".link_label", name: @blob.filename), @blob.expiring_service_url)
= render 'shared/mailers/signoff_instance'

View File

@@ -1,5 +1,5 @@
%br
%p.callout
%p
= t('.signoff')
%br
#{@order.distributor.contact_name}

View File

@@ -10,3 +10,5 @@
enterprise_for_logo: @enterprise_for_logo }
= link_to t('spree.order_mailer.cancel_email_for_shop.view_cancelled_order'), spree.edit_admin_order_url(@order)
= render 'shared/mailers/signoff_instance'

View File

@@ -34,3 +34,5 @@
%p.lead
= t('.thanks')
= render 'shared/mailers/signoff_distributor'

View File

@@ -14,4 +14,4 @@
%p
= t('.issue_text')
= render 'shared/mailers/signoff'
= render 'shared/mailers/signoff_instance'