|
|
@@ -7,8 +7,9 @@ module Agents
|
7
|
7
|
default_schedule "every_10m"
|
8
|
8
|
|
9
|
9
|
description <<-MD
|
10
|
|
- The TwilioAgent collects any events sent to it and send them via text message.
|
11
|
|
- Add more info
|
|
10
|
+ The TwilioAgent receives and collects events and send them via text message to cellphone when scheduled. Right now, it is assumed that events have `:message` key, the value of which is sent as the content of the text message.
|
|
11
|
+ Set `:receiverscell` to the number on which you would like to receive text messages.
|
|
12
|
+ `:expected_receive_period_in_days` is maximum days that you would expect to pass between events being received by this agent.
|
12
|
13
|
MD
|
13
|
14
|
|
14
|
15
|
def default_options
|
|
|
@@ -22,7 +23,7 @@ module Agents
|
22
|
23
|
end
|
23
|
24
|
|
24
|
25
|
def validate_options
|
25
|
|
- errors.add(:base, "account_sid,auth_token,senderscell,receiverscell are all required") unless options[:account_sid].present? && options[:auth_token].present? && options[:senderscell].present? && options[:receiverscell].present? && options[:expected_receive_period_in_days].present?
|
|
26
|
+ errors.add(:base, "account_sid,auth_token,senderscell,receiverscell,expected_receive_period_in_days are all required") unless options[:account_sid].present? && options[:auth_token].present? && options[:senderscell].present? && options[:receiverscell].present? && options[:expected_receive_period_in_days].present?
|
26
|
27
|
end
|
27
|
28
|
|
28
|
29
|
def receive(incoming_events)
|