Skip to content

Conversation

@vitalii-t
Copy link
Collaborator

@vitalii-t vitalii-t commented Nov 2, 2025

Motivation

Actualize README data

Changes

  • Updated README.md structure, added more examples
  • Updated API Reference section with actual examples

Summary by CodeRabbit

  • Documentation
    • Overhauled README with branding banner, updated badges, Prerequisites and onboarding steps (signup, domain verification) and clearer install guidance (includes Maven snippet with v1.1.0).
    • Renamed/expanded Minimal usage to “Minimal usage (Transactional sending)”; removed reply-to example and added token-based examples.
    • Added Sandbox vs Production and Bulk workflows with quick-switch examples.
    • Added full-featured examples (HTML, attachments, headers, templates), bulk/stream sample, and reorganized API reference and contributing/build guidance.

@coderabbitai
Copy link

coderabbitai bot commented Nov 2, 2025

Warning

Rate limit exceeded

@vitalii-t has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 29ce56a and d81af44.

📒 Files selected for processing (1)
  • README.md (3 hunks)

Walkthrough

README rewritten with expanded onboarding, detailed Maven/Gradle examples, distinct minimal/sandbox/production/bulk usage flows and extensive full-featured examples; a single method parameter in MailtrapClient was marked final (no behavior change).

Changes

Cohort / File(s) Summary
Documentation Enhancement
README.md
Replaced header/title with branding banner and updated badges; added Prerequisites and onboarding steps (signup, domain verification); clarified Maven and Gradle dependency blocks (added explicit Maven snippet v1.1.0); reorganized Usage into "Minimal usage (Transactional sending)", Sandbox vs Production, Full-featured, Bulk and Batch examples; adjusted samples to token-based configuration and consistent builder usage; added sandbox/production/bulk switching examples; expanded templates, inline attachments, custom headers; renamed/restructured API Reference sections; updated Contributing/Build wording.
API / Method signature change
src/main/java/io/mailtrap/client/MailtrapClient.java
Made the inboxId parameter final in MailtrapClient.switchToEmailTestingApi(final Long inboxId); no runtime or behavioral changes.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Client as MailtrapClient
    participant API as Mailtrap Service
    rect rgba(135,206,250,0.12)
        Note over Dev,Client: Configure client (token, host, optional inboxId, mode)
    end
    Dev->>Client: instantiate(token, env=sandbox|prod|bulk)
    alt Sandbox (email testing)
        Client->>API: POST /send (with inboxId param) [sandbox]
        API-->>Client: 200 OK (sandbox inbox message)
    else Production (transactional)
        Client->>API: POST /send [production]
        API-->>Client: 202 Accepted
    end
    alt Bulk/Batch sending
        Dev->>Client: switchMode(bulk)
        Client->>API: POST /send/bulk (batch payload)
        API-->>Client: 202 Accepted (batch id)
    end
Loading
sequenceDiagram
    participant Dev as Developer
    participant Client as MailtrapClient
    Note over Dev,Client: simple flow for switching to Email Testing API
    Dev->>Client: switchToEmailTestingApi(inboxId)
    Client->>Client: set sendingContextHolder.inboxId = inboxId
    Client->>API: subsequent requests target /email-testing using inboxId
    API-->>Client: responses reflect sandbox/inbox context
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to README code snippets for accuracy (Maven snippet version, token-based builder usage).
  • Verify renamed API reference links and headings.
  • Quick check of MailtrapClient.switchToEmailTestingApi signature change for compatibility.

Poem

🐰✨ I hopped into docs and nudged a line,
Banners, badges, examples — tidy and fine.
Sandbox, prod, bulk — I bound and spin,
Tokens, templates, attachments tucked in.
A carrot-tip README — hoppity grin! 🥕📧

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The pull request title "Updated README.md" is vague and generic, as it merely indicates that the README file was modified without conveying meaningful information about what changes were actually made. The raw summary reveals extensive updates including branding banner changes, added prerequisites and onboarding steps, restructured examples (including sandbox/production/bulk workflows), expanded API reference sections, and numerous new code samples. The title uses a non-descriptive term ("Updated") that doesn't summarize the primary intent or scope of the changes, making it difficult for a reviewer scanning the commit history to understand the significance of the modification.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed The pull request description follows the repository template structure with both the required "Motivation" and "Changes" sections present. The Motivation section clearly states "Actualize README data," indicating the intent to update documentation. The Changes section lists two main updates: restructuring the README and adding examples, plus updating the API Reference. While the description is missing the "How to test" and "Images and GIFs" sections from the template, these sections may not be applicable to a documentation-only update. However, the Changes section lacks specificity—items like "updated README.md structure" and "added more examples" are somewhat generic and don't fully capture the detailed scope of changes visible in the raw summary (such as branding changes, prerequisites additions, sandbox/production/bulk workflows, etc.).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e407ad8 and 53a89b6.

📒 Files selected for processing (1)
  • README.md (4 hunks)
🔇 Additional comments (4)
README.md (4)

1-36: Clear header and installation instructions — nicely structured.

The branding, badges, and installation details across package managers are well-organized and consistent. Prerequisites section is helpful for onboarding.


40-81: Minimal example is clear and complete.

Well-structured introductory example with proper error handling and straightforward API usage.


375-390: Contributing and build sections are well-structured.

Clear guidance for contributors with proper setup instructions and code of conduct reference.


328-373: All example file paths in the API Reference section are valid and accessible.

Verification confirms all 25 example file references in lines 328-373 exist in the repository. No broken links or missing files detected.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
README.md (2)

141-149: ❌ CRITICAL BUG NOT FIXED: Bulk stream example still shows incorrect configuration.

This is a duplicate of a previous critical issue. The code block still shows .sandbox(true) and includes .inboxId(INBOX_ID), but the description correctly states it should use .bulk(true) instead. The example code does not match the description and will mislead users attempting to implement bulk sending.

Apply this diff to fix the example:

         Bulk stream example (optional) differs only by setting `.bulk(true)` instead of `.sandbox(true)`:

         ```java
         final MailtrapConfig config = new MailtrapConfig.Builder()
-    .token(TOKEN)
+            .token(TOKEN)
+            .bulk(true)
-    .sandbox(true)
-    .inboxId(INBOX_ID)
             .build();
         ```

313-314: ❌ CRITICAL BUG NOT FIXED: Copy-paste error in class reference.

This is a duplicate of a previous critical issue. Line 314 incorrectly references EverythingExample.class when this code is part of the FullFeaturedExample class. This will cause a ClassLoaderException or runtime error when users attempt to run this example.

Apply this diff to correct the class reference:

     private static String readAndEncodeAttachment(final String filename) {
-        try (final InputStream inputStream = EverythingExample.class.getClassLoader().getResourceAsStream(filename)) {
+        try (final InputStream inputStream = FullFeaturedExample.class.getClassLoader().getResourceAsStream(filename)) {
             if (inputStream == null) {
                 return "";
             }
🧹 Nitpick comments (1)
README.md (1)

330-330: Improve link text descriptiveness.

The link text "[here]" is not descriptive. Consider using more meaningful text that conveys what users will find at the destination.

Apply this diff:

-You can find the API reference [here](https://mailtrap.github.io/mailtrap-java/index.html).
+You can find the [Javadoc API reference](https://mailtrap.github.io/mailtrap-java/index.html).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53a89b6 and 9611aac.

📒 Files selected for processing (1)
  • README.md (3 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md

330-330: Link text should be descriptive

(MD059, descriptive-link-text)

🔇 Additional comments (1)
README.md (1)

1-374: Well-structured documentation update with comprehensive examples.

The README reorganization is excellent—clear prerequisites section, multi-workflow examples (minimal, sandbox/production, switching, full-featured), and expanded API reference with better categorization. The code examples are generally well-formatted and instructive. However, the two critical bugs flagged in the previous review remain unfixed and must be addressed before merging.

Please verify that the two critical bugs (bulk example configuration and class reference) have been intentionally deferred or if this is an oversight that should be corrected in this PR.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
README.md (1)

327-327: Improve link text for accessibility.

The link text "here" is not descriptive for screen reader users. Consider using more descriptive text that makes sense when read out of context.

Apply this diff to improve accessibility:

-You can find the API reference [here](https://mailtrap.github.io/mailtrap-java/index.html).
+You can find the [Mailtrap Java API reference](https://mailtrap.github.io/mailtrap-java/index.html) documentation.

Alternatively:

-You can find the API reference [here](https://mailtrap.github.io/mailtrap-java/index.html).
+The [API reference](https://mailtrap.github.io/mailtrap-java/index.html) is available online.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9611aac and 29ce56a.

📒 Files selected for processing (2)
  • README.md (3 hunks)
  • src/main/java/io/mailtrap/client/MailtrapClient.java (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md

327-327: Link text should be descriptive

(MD059, descriptive-link-text)

🔇 Additional comments (8)
src/main/java/io/mailtrap/client/MailtrapClient.java (1)

111-111: LGTM! Good immutability practice.

Marking the parameter as final prevents accidental reassignment and clarifies intent without changing runtime behavior.

README.md (7)

1-36: LGTM! Clear and comprehensive onboarding.

The updated header, prerequisites, and installation instructions provide excellent onboarding for new users with all major build tools covered.


38-81: LGTM! Excellent minimal example.

The streamlined example focuses on essential parameters only, making it easier for new users to get started quickly.


141-148: Previous issue resolved! Bulk example is now correct.

The code now correctly demonstrates bulk configuration with .bulk(true) instead of .sandbox(true), and appropriately omits .inboxId().


310-319: Previous issue resolved! Class reference is now correct.

The resource loader now correctly references FullFeaturedExample.class, matching the actual class name and preventing runtime errors.


150-196: LGTM! Clear demonstration of API switching.

This example effectively demonstrates how to dynamically switch between Production, Bulk, and Sandbox modes, showcasing the client's flexibility.


198-321: LGTM! Comprehensive advanced example.

This full-featured example excellently demonstrates HTML emails, inline attachments, custom headers, and template-based sending, providing users with a solid reference for advanced use cases.


325-371: LGTM! Well-organized API reference navigation.

The updated API reference section provides clear navigation to all example files, with logical categorization across General, Sending, Testing, Bulk, Contacts, and Email Templates APIs.

@vitalii-t vitalii-t requested a review from yanchuk November 3, 2025 20:31
@yanchuk yanchuk merged commit bee3b04 into main Nov 4, 2025
2 checks passed
@yanchuk yanchuk deleted the readme-update branch November 4, 2025 11:51
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