feat(mail): add --reply-to-message-id to drafts create#15
Open
okuegow wants to merge 1 commit into
Open
Conversation
Create a draft as a threaded reply via Graph createReply (keeping the quoted original) and leave it in the Drafts folder for review instead of sending. --to/--subject become optional: recipients default to the original sender and are only overridden when supplied. Also adds --cc/--bcc to drafts create. If setting recipients fails, the half-built draft is deleted and the deletion outcome is reported so the error never claims removal when the orphan remains.
Author
|
Hi @visionik — hope you're well, and thanks for mog, it's become a daily driver for me. I know mogcli is a side project, so no pressure, but I've got three small, self-contained, tested PRs sitting open that I'd love to get in:
All three are green and mergeable. Happy to squash them into a single PR if that's easier to review — just say the word. And if it'd take maintenance off your plate: I'm glad to help co-maintain / triage the mog side. Either way, no rush — just flagging that they're ready whenever you have a minute. 🙏 |
This was referenced Jun 29, 2026
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
Adds a
--reply-to-message-id <id>flag tomog mail drafts create.When set, the draft is created as a threaded reply via Graph's
createReplyaction (which keeps the quoted original and conversation threading) and is left in the Drafts folder for review instead of being sent. This complements the existingmail send --reply-to-message-id, which sends immediately — the new flag is for the "draft, review, then send" workflow.Behaviour
--to/--subjectbecome optional. Recipients default to the original sender (filled in bycreateReply) and are only overridden when--to/--cc/--bccare supplied.--cc/--bcctomail drafts createfor the non-reply case (previously unavailable).--body/--body-filetext is passed as thecreateReplycomment so it lands above the quoted original.--body-fileread errors are now wrapped consistently withmail send.Tests
TestMailDraftsCreateCmd_Replycovers:createReplyis used and the draft is never sent; the user text rides along as thecomment; recipients are patched only when supplied (otherwise the original sender is kept);createReplyAPI errors surface; a response without an id is an error; and a recipient-patch failure deletes the orphaned draft.Notes
main(no dependency on the other open PRs).--attachmentflag) lands.