Sha256: d759ce36e98a986f889ed0d19701e58ed6c599eedd6c24a63afd4d0263435497

Contents?: true

Size: 773 Bytes

Versions: 14

Compression:

Stored size: 773 Bytes

Contents

module Spree
  module MailHelper
    include BaseHelper

    def variant_image_url(variant)
      image = default_image_for_product_or_variant(variant)
      image ? main_app.url_for(image.url(:small)) : 'noimage/small.png'
    end

    def name_for(order)
      order.name || Spree.t('customer')
    end

    def store_logo
      @order&.store&.mailer_logo || @order&.store&.logo || current_store.mailer_logo || current_store.logo
    end

    def default_logo
      Spree::Config.mailer_logo || Spree::Config.logo
    end

    def logo_path
      return default_logo unless store_logo.attached?
      return main_app.url_for(store_logo.variant(resize: '244x104>')) if store_logo.variable?

      return main_app.url_for(store_logo) if store_logo.image?
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
spree_core-4.2.7 app/helpers/spree/mail_helper.rb
spree_core-4.2.6 app/helpers/spree/mail_helper.rb
spree_core-4.2.5 app/helpers/spree/mail_helper.rb
spree_core-4.2.4 app/helpers/spree/mail_helper.rb
spree_core-4.2.3.1 app/helpers/spree/mail_helper.rb
spree_core-4.2.3 app/helpers/spree/mail_helper.rb
spree_core-4.2.2 app/helpers/spree/mail_helper.rb
spree_core-4.2.1 app/helpers/spree/mail_helper.rb
spree_core-4.2.0 app/helpers/spree/mail_helper.rb
spree_core-4.2.0.rc5 app/helpers/spree/mail_helper.rb
spree_core-4.2.0.rc4 app/helpers/spree/mail_helper.rb
spree_core-4.2.0.rc3 app/helpers/spree/mail_helper.rb
spree_core-4.2.0.rc2 app/helpers/spree/mail_helper.rb
spree_core-4.2.0.rc1 app/helpers/spree/mail_helper.rb