[IP-394]: Add CC email addresses per client for invoice emails. (Closes #394)#600
Conversation
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
Modules/Clients/Database/Migrations/2026_07_13_000000_add_email_cc_to_relations_table.phpModules/Clients/Filament/Company/Resources/Relations/Schemas/RelationForm.phpModules/Clients/Models/Relation.phpModules/Clients/Services/RelationService.phpModules/Clients/Tests/Feature/CustomersTest.phpresources/lang/en/ip.php
| 'cc_email_addresses' => 'CC Email Addresses', | ||
| 'cc_email_addresses_helper' => 'These addresses will be automatically CC\'d on every email sent to this client.', |
There was a problem hiding this comment.
🎯 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.
| '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.
There was a problem hiding this comment.
This is just a helper message.
There was a problem hiding this comment.
@nielsdrost7 what do you think about this?
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
what do you think about this?
@KhawarMehfooz
Don't worry about it. Coderabbit is delusional sometimes.
There was a problem hiding this comment.
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!
…ad of JSON on relations
Pull Request Checklist
Checklist
Description
Adds a
email_ccfield to clients (relationstable) 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 Eloquentarraycast.Note: this PR covers CC-address storage only. The invoice "Send Email" action /
MailQueuepipeline that will actually consumeemail_ccand pass it toMail::cc()does not exist yet in this codebase (InvoiceService::sendInvoiceEmail()is referenced but unimplemented, andMailQueueService/MailerService/MailBuilderare 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)
Screenshots (If Applicable)
Summary by CodeRabbit
New Features
Bug Fixes
Tests