Skip to content

MT-21887: Update account billing usage for marketing plan#39

Open
edwardhura wants to merge 1 commit intomainfrom
MT-21887-expose-email-campaigns-usage-in-account-billing-API
Open

MT-21887: Update account billing usage for marketing plan#39
edwardhura wants to merge 1 commit intomainfrom
MT-21887-expose-email-campaigns-usage-in-account-billing-API

Conversation

@edwardhura
Copy link
Copy Markdown

@edwardhura edwardhura commented May 11, 2026

Motivation

Changes

  • Update billing usage API to support marketing

How to test

N/A

Images and GIFs

N/A

Summary by CodeRabbit

  • Documentation
    • Expanded the account billing usage API endpoint to include Email Campaigns usage metrics, now providing current sent message counts and plan limits alongside existing Email Sandbox and Email Sending data.

Review Change Stack

@edwardhura edwardhura self-assigned this May 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

This PR updates the OpenAPI specification for the account billing usage endpoint to document Email Campaigns usage metrics. The operation description, response schema, and example payload are expanded to include a marketing section with plan information and sent message count tracking (current and limit).

Changes

Email Campaigns Billing Usage Documentation

Layer / File(s) Summary
Operation Description
specs/account-management.openapi.yml
getAccountBillingUsage endpoint description updated to include Email Campaigns usage alongside Email Sandbox and Email Sending.
Response Schema Structure
specs/account-management.openapi.yml
Response schema extended with a marketing section containing plan metadata and usage.sent_messages_count with current and limit fields.
Response Documentation and Example
specs/account-management.openapi.yml
Response description clarified to note that Email Campaigns usage is returned when available; example payload extended with a marketing block showing plan name and message counts.

🎯 2 (Simple) | ⏱️ ~8 minutes

A marketing tale takes flight,
Usage counted, limits in sight,
Campaigns now tracked in the spec,
One endpoint, fully checked! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description follows the required template structure but lacks detail in key sections. Motivation is empty, Changes section is minimal, and testing/images are marked N/A without elaboration. Expand the Motivation section to explain why marketing plan usage needs to be exposed, provide more detailed Changes with specifics about the new marketing schema, and clarify why testing is N/A.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: updating the account billing usage API to include marketing plan information.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MT-21887-expose-email-campaigns-usage-in-account-billing-API

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@edwardhura edwardhura requested review from VladimirTaytor and i7an May 11, 2026 10:33
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@specs/account-management.openapi.yml`:
- Line 877: Update the operation description that currently reads "Get current
billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email
Campaigns." to use the official product name by replacing "Email Campaigns" with
"Email Marketing" (or "Marketing" if brevity is desired) so it reads for
example: "Get current billing cycle usage for Email Sandbox, Email Sending
(Email API/SMTP), and Email Marketing." Locate the description field in the same
OpenAPI operation and make this single-string replacement.
- Line 949: Update the OpenAPI response description that currently says "Email
Campaigns" to use the official product naming "Email Marketing" (or "Marketing")
instead; locate the description field in the response object (the description
property shown in the diff) and replace "Email Campaigns" with "Email Marketing"
so the sentence reads: "Returns an object with current billing cycle usage for
Sandbox, Email Sending (Email API/SMTP), and Email Marketing if available."
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ad8ca32-ba4d-4519-809b-b51af178472f

📥 Commits

Reviewing files that changed from the base of the PR and between bce2ba6 and e9036a0.

📒 Files selected for processing (1)
  • specs/account-management.openapi.yml

operationId: getAccountBillingUsage
summary: Get current billing cycle usage
description: Get current billing cycle usage for Email Sandbox and Email Sending (Email API/SMTP).
description: Get current billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email Campaigns.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use official product naming: "Email Marketing" instead of "Email Campaigns".

The operation description should use "Email Marketing" (or shortened to "Marketing") instead of "Email Campaigns" to align with official Mailtrap product naming.

📝 Proposed fix
-      description: Get current billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email Campaigns.
+      description: Get current billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email Marketing.

As per coding guidelines: Use official product naming: 'Email Marketing' (can shorten to 'Marketing').

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Get current billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email Campaigns.
description: Get current billing cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email Marketing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/account-management.openapi.yml` at line 877, Update the operation
description that currently reads "Get current billing cycle usage for Email
Sandbox, Email Sending (Email API/SMTP), and Email Campaigns." to use the
official product name by replacing "Email Campaigns" with "Email Marketing" (or
"Marketing" if brevity is desired) so it reads for example: "Get current billing
cycle usage for Email Sandbox, Email Sending (Email API/SMTP), and Email
Marketing." Locate the description field in the same OpenAPI operation and make
this single-string replacement.

responses:
'200':
description: Returns an object with current billing cycle usage for Sandbox and Email Sending (Email API/SMTP) if available.
description: Returns an object with current billing cycle usage for Sandbox, Email Sending (Email API/SMTP), and Email Campaigns if available.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use official product naming: "Email Marketing" instead of "Email Campaigns".

The response description should use "Email Marketing" (or shortened to "Marketing") instead of "Email Campaigns" to align with official Mailtrap product naming.

📝 Proposed fix
-          description: Returns an object with current billing cycle usage for Sandbox, Email Sending (Email API/SMTP), and Email Campaigns if available.
+          description: Returns an object with current billing cycle usage for Sandbox, Email Sending (Email API/SMTP), and Email Marketing if available.

As per coding guidelines: Use official product naming: 'Email Marketing' (can shorten to 'Marketing').

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/account-management.openapi.yml` at line 949, Update the OpenAPI
response description that currently says "Email Campaigns" to use the official
product naming "Email Marketing" (or "Marketing") instead; locate the
description field in the response object (the description property shown in the
diff) and replace "Email Campaigns" with "Email Marketing" so the sentence
reads: "Returns an object with current billing cycle usage for Sandbox, Email
Sending (Email API/SMTP), and Email Marketing if available."

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.

1 participant