rav-meser-api 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rav-meser-api.rb +40 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4761b16181712908553fbc2041d183fecff26740
|
4
|
+
data.tar.gz: f5245f697b4a48b974b210c729397b7f343753ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13d3e087768f3414afb4901a486f8565d685b97b6cb48272957c2e38e4dbdc373dfba9ecdb5030a0eba7080ccb20e61d89907e783f9bb0eaf144830dae8feced
|
7
|
+
data.tar.gz: bb15e8539a152d68c7bad1f9fb8de193959db5ab5af848c02671e68bfc56e28fb2905ae63cae2a21a8bd06485945b28ac6099b797f2f2b470fd1276610f4a37a
|
data/lib/rav-meser-api.rb
CHANGED
@@ -189,6 +189,46 @@ class RavMeser
|
|
189
189
|
send_request(:post, 'personal_fields', '/' + id.to_s + '/personal_fields?', %w[method delete], args)
|
190
190
|
end
|
191
191
|
|
192
|
+
# create new message to specific list
|
193
|
+
#
|
194
|
+
# Example:
|
195
|
+
# >> RavMeser.create_message(123456, {'TYPE' => 1, 'BODY_TYPE' => 0, 'SUBJECT' => 'subject2', 'BODY' => 'message HTML body'} )
|
196
|
+
# => {"ERRORS"=>[], "MESSAGE_ID"=>3586177}
|
197
|
+
#
|
198
|
+
# Arguments:
|
199
|
+
# id: (int)
|
200
|
+
# args: (Hash)
|
201
|
+
def create_message(id, args)
|
202
|
+
send_request(:post, 'info', '/' + id.to_s + '/messages', [], args)
|
203
|
+
end
|
204
|
+
|
205
|
+
# send message of specific list
|
206
|
+
#
|
207
|
+
# Example:
|
208
|
+
# >> RavMeser.send_message(123456, 565656)
|
209
|
+
# => {"MESSAGE_SENT"=>true}
|
210
|
+
#
|
211
|
+
# Arguments:
|
212
|
+
# list_id: (int)
|
213
|
+
# msg_id: (int)
|
214
|
+
def send_message(list_id, msg_id)
|
215
|
+
send_request(:post, '', '/' + list_id.to_s + '/messages/' + msg_id.to_s , [], {} )
|
216
|
+
end
|
217
|
+
|
218
|
+
# create and send message of specific list
|
219
|
+
#
|
220
|
+
# Example:
|
221
|
+
# >> RavMeser.create_and_send_message(123456, {'TYPE' => 1, 'BODY_TYPE' => 0, 'SUBJECT' => 'subject2', 'BODY' => 'message HTML body'})
|
222
|
+
# => {"MESSAGE_SENT"=>true}
|
223
|
+
#
|
224
|
+
# Arguments:
|
225
|
+
# list_id: (int)
|
226
|
+
# args: (Hash)
|
227
|
+
def create_and_send_message(id, msg)
|
228
|
+
res = create_message(id, msg)
|
229
|
+
send_message(id, res["MESSAGE_ID"])
|
230
|
+
end
|
231
|
+
|
192
232
|
# privare method
|
193
233
|
# common code to send the requests
|
194
234
|
#
|