10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/mailers/spree/order_mailer_decorator.rb', line 10
def confirm_email(order, resend: false)
@order = order.respond_to?(:id) ? order : Spree::Order.find(order)
return false if @order.email.blank?
@tenant = @order.tenant
if @tenant.present?
@brand_color = @tenant.preferences[:brand_primary_color]
@vendor_logo_url = @tenant.active_vendor&.logo&.original_url
end
@current_store = @order.store
@product_type = @order.products.first&.product_type || 'accommodation'
subject = resend ? "[#{Spree.t(:resend).upcase}] " : ''
subject += "#{@current_store&.name} Booking Confirmation ##{@order.number}"
mail(to: @order.email, from: from_email_address, subject: subject, store_url: @current_store.url) do |format|
format.html { render layout: 'spree_cm_commissioner/layouts/order_mailer' }
format.text
end
end
|