| Class | Mack::Notifier::Adapters::Xmpp |
| In: |
lib/mack-notifier/adapters/xmpp_msg.rb
|
| Parent: | Mack::Notifier::Adapters::Base |
All mail adapters need to extend this class.
Convert the Mack::Notifier object to the adapted object.
# File lib/mack-notifier/adapters/xmpp_msg.rb, line 30
30: def convert
31: settings = configatron.mack.notifier.xmpp_settings
32: arr = [mack_notifier.to].flatten
33: @xmpp_container = XmppMsgContainer.new
34: @xmpp_container.recipients = arr
35:
36: arr.each do |rcpt|
37: xmpp_msg = Message::new
38: xmpp_msg.set_type(:normal)
39: xmpp_msg.set_to(rcpt)
40: xmpp_msg.set_from(mack_notifier.from)
41: xmpp_msg.set_subject(mack_notifier.subject)
42: xmpp_msg.set_type(settings.message_type)
43: unless mack_notifier.body(:plain).blank?
44: xmpp_msg.set_body(mack_notifier.body(:plain))
45: end
46:
47: @xmpp_container.messages << xmpp_msg
48: end
49:
50: return @xmpp_container
51: end
The RAW encoded String ready for delivery via SMTP, Sendmail, etc…
# File lib/mack-notifier/adapters/xmpp_msg.rb, line 54
54: def deliverable
55: return @xmpp_container
56: end
The transformed (ie, converted, object)
# File lib/mack-notifier/adapters/xmpp_msg.rb, line 24
24: def transformed
25: raise Mack::Errors::UnconvertedNotifier.new if @xmpp_msg.nil?
26: return @xmpp_container
27: end