Module: Spree::OrderMailerDecorator
- Defined in:
- app/mailers/spree/order_mailer_decorator.rb
Instance Method Summary collapse
Instance Method Details
#cancel_email(order, resend: false) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/mailers/spree/order_mailer_decorator.rb', line 3 def cancel_email(order, resend: false) @order = order.respond_to?(:id) ? order : Spree::Order.find(order) return false if @order.email.blank? setup_tenant_and_store if @tenant.present? @name = @order.tenant.name @logo = @order.tenant.active_vendor&.logo&.original_url @brand_color = @order.tenant.preferred_brand_primary_color end @product_type = @order.products.first&.product_type || 'accommodation' mail(to: @order.email, from: from_email_address, subject: cancel_subject(resend), store_url: store_url ) do |format| format.html { render layout: 'spree_cm_commissioner/layouts/cancel_order_mailer' } format.text end end |
#confirm_email(order, resend: false) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/mailers/spree/order_mailer_decorator.rb', line 25 def confirm_email(order, resend: false) @order = order.respond_to?(:id) ? order : Spree::Order.find(order) return false if @order.email.blank? setup_tenant_and_store if @tenant.present? @name = @order.tenant.name @logo = @order.tenant.active_vendor&.logo&.original_url @brand_color = @order.tenant.preferred_brand_primary_color end @product_type = @order.products.first&.product_type || 'accommodation' subject = build_subject(resend) mail(to: @order.email, from: from_email_address, subject: subject, store_url: store_url ) do |format| format.html { render layout: 'spree_cm_commissioner/layouts/order_mailer' } format.text end end |