Skip to content

Conversation

@AaronDDM
Copy link
Collaborator

What did you do?

  • Added is_plaintext support to SendMessageRequest and CreateDraftRequest

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@playerzero-ai
Copy link

playerzero-ai bot commented Aug 28, 2025

Pull Request Summary

  • Feature Addition: Introduced support for an is_plaintext flag in SendMessageRequest and CreateDraftRequest to control whether emails are sent in plain text or HTML format.
  • Demonstration Methods: Added methods in example files to demonstrate the new plaintext feature, showcasing the ability to send both HTML and plain text emails.
  • User Control: Enhanced user options for email formatting, allowing explicit control over message content type, which can improve compatibility with text-only email clients.
  • Testing Enhancements: Added new test cases to ensure correct serialization and behavior of the is_plaintext flag, verifying default values and explicit settings.
  • User Experience: Improved user experience by providing clear examples and explanations of the differences between HTML and plain text emails, emphasizing the flexibility and control offered by the new feature.

Files Changed

File Name Summary
examples/src/main/java/com/nylas/examples/MessagesExample.java Added imports and a new method to demonstrate sending messages as plain text or HTML, showing success/failure and message IDs, highlighting control over message format via is_plaintext.
src/test/kotlin/com/nylas/resources/MessagesTests.kt Added tests verifying correct serialization and default behavior of the is_plaintext flag when sending messages, improving reliability of plaintext message handling.
examples/src/main/kotlin/com/nylas/examples/KotlinMessagesExample.kt Added a Kotlin example demonstrating sending messages as plaintext or HTML, explaining differences and showcasing the new isPlaintext feature.
src/main/kotlin/com/nylas/models/CreateDraftRequest.kt Added isPlaintext field to CreateDraftRequest to control whether drafts are sent as plain text or HTML, enhancing draft composition flexibility.
src/main/kotlin/com/nylas/models/SendMessageRequest.kt Added isPlaintext field to SendMessageRequest to specify message format as plain text or HTML, improving message formatting options.
src/test/kotlin/com/nylas/resources/DraftsTests.kt Added tests for is_plaintext flag in draft creation, verifying correct serialization, API call parameters, and default behavior to ensure proper handling of plain text drafts.

View more in PlayerZero
updated: Aug 28 @ 03:48 PM UTC

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.75%. Comparing base (72dada5) to head (d174f6c).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #297   +/-   ##
=========================================
  Coverage     81.75%   81.75%           
  Complexity      344      344           
=========================================
  Files            36       36           
  Lines          1014     1014           
  Branches         88       88           
=========================================
  Hits            829      829           
  Misses          132      132           
  Partials         53       53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AaronDDM AaronDDM merged commit ab3c426 into main Aug 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants