Sha256: f22150ffe03e553569ce753364e285407df9bb6eea0ab3cc87152d489816f084

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

module Roqua
  module CoreApi
    # @api private
    class SendTextMessageTo < ActiveInteraction::Base
      string :person_id
      hash :attributes do
        string :body
        string :reference, default: nil
      end
      string :username, default: ENV['CORE_BASICAUTH_ID']
      string :password, default: ENV['CORE_BASICAUTH_SECRET']

      # Possible variables in the body are:
      #   %firstname%,
      #   %lastname%,
      #   %initials%
      def execute
        CoreApi.basic_auth_session(username: username, password: password)
            .post "/text_messages", text_message: attributes, person_id: person_id
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roqua-core-api-0.2.4 lib/roqua/core_api/send_text_message_to.rb