Module: Viewpoint::EWS::MessageAccessors
Overview
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
Copyright
Constant Summary
Constants included from Viewpoint::EWS
Instance Attribute Summary
Attributes included from Viewpoint::EWS
Instance Method Summary collapse
-
#draft_message(opts = {}, &block) ⇒ Object
See #send_message for options.
-
#send_message(opts = {}) {|msg| ... } ⇒ Message, Boolean
Send an E-mail message.
Methods included from Viewpoint::EWS
#remove_impersonation, root_logger, #set_impersonation
Instance Method Details
#draft_message(opts = {}, &block) ⇒ Object
See #send_message for options
71 72 73 |
# File 'lib/ews/message_accessors.rb', line 71 def (opts = {}, &block) opts.merge(draft: true), &block end |
#send_message(opts = {}) {|msg| ... } ⇒ Message, Boolean
TODO:
Finish ItemAttachments
Send an E-mail message
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ews/message_accessors.rb', line 43 def (opts = {}, &block) msg = Template::Message.new opts.clone yield msg if block_given? if msg. draft = msg.draft msg.draft = true resp = parse_create_item(ews.create_item(msg.to_ews)) msg..each do |f| next unless f.kind_of?(File) or f.kind_of?(Tempfile) resp.(f) end msg..each do |f| next unless f.kind_of?(File) or f.kind_of?(Tempfile) resp.(f) end if draft resp. resp else resp.submit! end else resp = ews.create_item(msg.to_ews) resp. ? parse_create_item(resp) : false end end |