Repository navigation
Allow sending a message from MIME content and setting its MessageDisposition - #306
Merged
Merged
Conversation
…osition Template::Message now accepts `mime_content` (Base64-encoded MIME) plus an optional `mime_content_charset` (default UTF-8), and an explicit `message_disposition` that overrides the draft-derived default. The builder's `mime_content!` used to emit `IncludeMimeContent`, so a `mime_content` key in an item hash (Message, CalendarItem, Task) produced the wrong element. It is renamed to `include_mime_content!` and `mime_content!` now builds `t:MimeContent` with its CharacterSet.
Contributor
|
@fjaeger thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change is this?
Feature, plus a bugfix in the SOAP builder.
Did you add tests for your changes?
Yes:
spec/unit/templates/message_spec.rb(new) and two examples inspec/unit/soap/builders/ews_builder_spec.rb.bundle exec rspecandbundle exec rubocoppass locally.Summary of changes
We send and schedule mail through EWS from a raw RFC 822 message, so we need
CreateItemwitht:MimeContentinstead of subject/body/recipients. We have run this from a fork since 2023 and would like to stop.Template::Messageacceptsmime_content(Base64-encoded MIME) and an optionalmime_content_charset(defaultUTF-8). It is emitted ast:MimeContentwith aCharacterSetattribute.Template::Messageaccepts an explicitmessage_disposition(SaveOnly,SendOnly,SendAndSaveCopy). Without one, it still derives it fromdraft, as before.EwsBuilder#mime_content!used to emitt:IncludeMimeContent(for item shapes). Item hashes are built withsend("#{key}!", value), so amime_contentkey in a Message, CalendarItem or Task hash (CalendarItem/Tasktemplates already listmime_contentinPARAMETERS) produced the wrong element. The item-shape helper is renamed toinclude_mime_content!andmime_content!now buildst:MimeContent.Example:
Other information
mime_content!is a public builder method, so callers that invoked it directly to buildIncludeMimeContentneedinclude_mime_content!now.item_shape!was the only caller in the gem. Happy to keep a deprecated alias or take a different approach if you prefer.