Module: Viewpoint::EWS::MessageAccessors
Overview
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
Copyright © 2011 Dan Wanek <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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 |