Sha256: 6ebc77b578cd12c433341ff05d9a2b8ea5ed6fb016705b55cf3701165897d7d1

Contents?: true

Size: 983 Bytes

Versions: 5

Compression:

Stored size: 983 Bytes

Contents

module Roqua
  module CoreApi
    # @api private
    class SendNotification < ActiveInteraction::Base
      string :person_id, default: nil # if nil, to must be present.
      string :dossier_id, default: nil
      hash :attributes do
        string :body_short
        string :body_long
        string :notification_type, default: nil
        string :reference
        string :subject
        hash :addresses, default: nil, strip: false
        hash :variables, strip: false, default: {}
        array :notify_by do # [:sms, :email]
          string
        end
      end

      # Possible variables in the body/subject are:
      #   %firstname%,
      #   %lastname%,
      #   %initials%
      def execute
        CoreApi.basic_auth_session.post "/notifications", notification: attributes,
                                                          person_id: person_id,
                                                          dossier_id: dossier_id
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roqua-core-api-0.7.0 lib/roqua/core_api/send_notification.rb
roqua-core-api-0.6.0 lib/roqua/core_api/send_notification.rb
roqua-core-api-0.5.0 lib/roqua/core_api/send_notification.rb
roqua-core-api-0.4.0 lib/roqua/core_api/send_notification.rb
roqua-core-api-0.3.1 lib/roqua/core_api/send_notification.rb