Class: NetGSM::XmlBody
- Inherits:
-
Object
- Object
- NetGSM::XmlBody
- Defined in:
- lib/netgsm_sms/xml_body.rb
Class Method Summary collapse
- .send_mass_sms_body(message_array, valid_options) ⇒ Object
- .send_sms_body(recipient, message_text, valid_options) ⇒ Object
Class Method Details
.send_mass_sms_body(message_array, valid_options) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/netgsm_sms/xml_body.rb', line 22 def self.send_mass_sms_body(, ) result = "<?xml version='1.0'?> <mainbody> <header> <company #{"dil='TR'" if [:turkish] == true}>NETGSM</company> <usercode>#{NetGSM.configuration.usercode}</usercode> <password>#{NetGSM.configuration.password}</password> <startdate>#{[:start_date]}</startdate> <stopdate>#{[:stop_date]}</stopdate> <type>n:n</type> <msgheader>#{[:from]}</msgheader> </header> <body> " + .map {|| "<mp><msg><![CDATA[#{[1]}]]></msg><no>#{[0]}</no></mp>" }.join("\n") + " </body> </mainbody>" #puts result return result end |
.send_sms_body(recipient, message_text, valid_options) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/netgsm_sms/xml_body.rb', line 3 def self.send_sms_body(recipient, , ) "<?xml version='1.0'?> <mainbody> <header> <company #{"dil='TR'" if [:turkish] == true}>NETGSM</company> <usercode>#{NetGSM.configuration.usercode}</usercode> <password>#{NetGSM.configuration.password}</password> <startdate>#{[:start_date]}</startdate> <stopdate>#{[:stop_date]}</stopdate> <type>1:n</type> <msgheader>#{[:from]}</msgheader> </header> <body> <msg><![CDATA[#{}]]></msg> <no>#{recipient}</no> </body> </mainbody>" end |