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