From f57e9967d115f878db847c369f6800a5fe759b12 Mon Sep 17 00:00:00 2001 From: Rodrigo Martinez Date: Mon, 8 Jul 2024 17:48:37 -0300 Subject: [PATCH] Fixed ordering on lines of code for setting dummy draft when submitting file attachments. This fixed problem that no message was sent when sending attachments. (#232) --- lib/ews/message_accessors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ews/message_accessors.rb b/lib/ews/message_accessors.rb index cdaace30..72c56cbd 100644 --- a/lib/ews/message_accessors.rb +++ b/lib/ews/message_accessors.rb @@ -45,8 +45,8 @@ def send_message(opts = {}, &block) yield msg if block_given? if msg.has_attachments? draft = msg.draft - msg.draft = true resp = parse_create_item(ews.create_item(msg.to_ews)) + msg.draft = true msg.file_attachments.each do |f| next unless f.kind_of?(File) or f.kind_of?(Tempfile) resp.add_file_attachment(f)