Sha256: 527205b42530c7a4e0e6bc06bde9cf1655d212668df70f7c85950cd6d4c9ba2e

Contents?: true

Size: 908 Bytes

Versions: 14

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  module Services
    class UpsFreight
      class LabelEmailOptions
        EMAIL_TYPES = {
          ship_notification: '001',
          delivery_notification: '002',
          exception_notification: '003',
          bol_labels: '004'
        }.freeze

        attr_reader :email_type,
                    :email,
                    :undeliverable_email,
                    :subject,
                    :body

        def initialize(
          email:,
          email_type:,
          undeliverable_email:,
          subject: nil,
          body: nil
        )
          @email = email
          @email_type = email_type
          @undeliverable_email = undeliverable_email
          @subject = subject
          @body = body
        end

        def email_type_code
          EMAIL_TYPES.fetch(email_type)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
friendly_shipping-0.9.0 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.8.1 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.8.0 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.7.3 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.7.2 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.7.1 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.7.0 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.6.5 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.6.4 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.6.3 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.6.2 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.6.1 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.6.0 lib/friendly_shipping/services/ups_freight/label_email_options.rb
friendly_shipping-0.5.3 lib/friendly_shipping/services/ups_freight/label_email_options.rb