Sha256: f804423023c8c0e636ffdec1ea2b5e56899c14e9f2dec21eb44ea1506da6daf3

Contents?: true

Size: 965 Bytes

Versions: 7

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

module Mailtrap
  module Mail
    class FromTemplate < Base
      attr_accessor :template_uuid, :template_variables

      def initialize( # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
        from: nil,
        to: [],
        cc: [],
        bcc: [],
        attachments: [],
        headers: {},
        custom_variables: {},
        template_uuid: nil,
        template_variables: {}
      )
        super(
          from: from,
          to: to,
          cc: cc,
          bcc: bcc,
          attachments: attachments,
          headers: headers,
          custom_variables: custom_variables
        )
        @template_uuid = template_uuid
        @template_variables = template_variables
      end

      def as_json
        super.merge(
          {
            'template_uuid' => template_uuid,
            'template_variables' => template_variables
          }
        ).compact
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mailtrap-2.1.2 lib/mailtrap/mail/from_template.rb
mailtrap-2.1.1 lib/mailtrap/mail/from_template.rb
mailtrap-2.1.0 lib/mailtrap/mail/from_template.rb
mailtrap-2.0.0 lib/mailtrap/mail/from_template.rb
mailtrap-1.2.2 lib/mailtrap/mail/from_template.rb
mailtrap-1.2.1 lib/mailtrap/mail/from_template.rb
mailtrap-1.2.0 lib/mailtrap/mail/from_template.rb