Skip to content

[IP-394]: Add CC email addresses per client for invoice emails. (Closes #394)#600

Merged
nielsdrost7 merged 2 commits into
InvoicePlane:developfrom
KhawarMehfooz:394/add-cc-email-addresses
Jul 13, 2026
Merged

[IP-394]: Add CC email addresses per client for invoice emails. (Closes #394)#600
nielsdrost7 merged 2 commits into
InvoicePlane:developfrom
KhawarMehfooz:394/add-cc-email-addresses

Conversation

@KhawarMehfooz

@KhawarMehfooz KhawarMehfooz commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Checklist

Checklist

  • My code follows the code formatting guidelines.
  • I have tested my changes locally.
  • I selected the appropriate branch for this PR.
  • I have rebased my changes on top of the selected branch.
  • I included relevant documentation updates if necessary.
  • I have an accompanying issue ID for this pull request.

Description

Adds a email_cc field to clients (relations table) so a company admin can store one or more CC email addresses per client. The client edit form gains a CC Email Addresses tags input, each address individually validated as a real email on save. Stored as a JSON array via an Eloquent array cast.

Note: this PR covers CC-address storage only. The invoice "Send Email" action / MailQueue pipeline that will actually consume email_cc and pass it to Mail::cc() does not exist yet in this codebase (InvoiceService::sendInvoiceEmail() is referenced but unimplemented, and MailQueueService/MailerService/MailBuilder are empty stubs) — wiring that up is left as follow-up work.


Related Issue(s)

Closes #394


Motivation and Context

Company admins currently have to manually add CC recipients every time they email an invoice to a client. Storing CC addresses on the client record is the first step toward automatically CC'ing them on outgoing invoice emails, removing that repetitive manual step.


Issue Type (Check one or more)

  • Bugfix
  • Improvement of an existing feature
  • New feature

Screenshots (If Applicable)

Screenshot 2026-07-13 at 11 00 28 PM

Summary by CodeRabbit

  • New Features

    • Added support for storing multiple CC email addresses on customer relations.
    • Added a CC email field to relation forms with email validation and helpful guidance.
    • CC addresses are preserved when creating or updating relations.
  • Bug Fixes

    • Invalid CC email addresses are now rejected with a clear validation error.
  • Tests

    • Added coverage for saving, retrieving, and validating CC email addresses.

@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@resources/lang/en/ip.php`:
- Around line 6-7: Update the cc_email_addresses_helper translation to avoid
promising automatic CC delivery while the Mail::cc() pipeline is deferred;
describe the addresses only as configured CC recipients or pending
functionality, without claiming they will be included on every email.
🪄 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: 8552639a-b9c8-46d1-a610-3cfe19fa1c6d

📥 Commits

Reviewing files that changed from the base of the PR and between 93ec359 and af91d2c.

📒 Files selected for processing (6)
  • Modules/Clients/Database/Migrations/2026_07_13_000000_add_email_cc_to_relations_table.php
  • Modules/Clients/Filament/Company/Resources/Relations/Schemas/RelationForm.php
  • Modules/Clients/Models/Relation.php
  • Modules/Clients/Services/RelationService.php
  • Modules/Clients/Tests/Feature/CustomersTest.php
  • resources/lang/en/ip.php

Comment thread resources/lang/en/ip.php
Comment on lines +6 to +7
'cc_email_addresses' => 'CC Email Addresses',
'cc_email_addresses_helper' => 'These addresses will be automatically CC\'d on every email sent to this client.',

@coderabbitai coderabbitai Bot Jul 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not promise automatic CC delivery before it exists.

The PR explicitly defers the Mail::cc() pipeline, but this text says every client email will be CC’d. Users may rely on CC recipients receiving invoices when no delivery integration runs yet.

Proposed fix
-    'cc_email_addresses_helper'        => 'These addresses will be automatically CC\'d on every email sent to this client.',
+    'cc_email_addresses_helper'        => 'These addresses are stored with this client.',
📝 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
'cc_email_addresses' => 'CC Email Addresses',
'cc_email_addresses_helper' => 'These addresses will be automatically CC\'d on every email sent to this client.',
'cc_email_addresses' => 'CC Email Addresses',
'cc_email_addresses_helper' => 'These addresses are stored with this client.',
🤖 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 `@resources/lang/en/ip.php` around lines 6 - 7, Update the
cc_email_addresses_helper translation to avoid promising automatic CC delivery
while the Mail::cc() pipeline is deferred; describe the addresses only as
configured CC recipients or pending functionality, without claiming they will be
included on every email.

@KhawarMehfooz KhawarMehfooz Jul 13, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is just a helper message.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@nielsdrost7 what do you think about this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@KhawarMehfooz, understood — I'll leave it as is. Since the CC delivery pipeline is a follow-up item, just keep this in mind for when that lands, so the helper text stays accurate for users.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what do you think about this?

@KhawarMehfooz
Don't worry about it. Coderabbit is delusional sometimes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 13, 2026
@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 13, 2026
@nielsdrost7 nielsdrost7 merged commit d086ad1 into InvoicePlane:develop Jul 13, 2026
1 of 5 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.

[Core]: Add CC email addresses per client for invoice emails

2 participants