lib/smess/outputs/etisalatdemo.rb in smess-1.0.2 vs lib/smess/outputs/etisalatdemo.rb in smess-1.0.3

- old
+ new

@@ -1,10 +1,13 @@ module Smess class Etisalatdemo include Smess::Logging - def initialize + attr_reader :sms + + def initialize(sms) + @sms = sms @smtp_settings = { address: "exmail.emirates.net.ae", port: 25, domain: 'eim.ae', user_name: ENV["SMESS_ETISALATDEMO_USER"], @@ -12,19 +15,17 @@ authentication: 'plain', enable_starttls_auto: false } end - def deliver_sms(sms) - return false unless sms.kind_of? Sms - @sms = sms - + def deliver local_from_var = from_address + local_sms = sms mail = Mail.new do from local_from_var - to "+#{sms.to}@email2sms.ae" + to "+#{local_sms.to}@email2sms.ae" subject "Smess Message" - body sms.message.strip_nongsm_chars + body local_sms.message.strip_nongsm_chars end mail.delivery_method :smtp, @smtp_settings begin \ No newline at end of file