BuiltEmail workspace

Deposit transaction receipt

Source: App\Mail\DepositTransaction, app/Mail/DepositTransaction.php; resources/views/emails/deposit-transaction-receipt.blade.php. Caller: app/Http/Controllers/Accounting/DepositTransactionsController.php::sendEmail (:535–571). Static references establish usage, not production delivery.

Subject: Deposit Transaction #{{transaction_id}} (preserve exact native pattern).

Suggested preheader: Deposit transaction #{{transaction_id}} with {{business_name}}.

Required portable values

TokenExisting sourceHandling
{{business_name}}transaction.business.nameEscaped business identity; not customer name.
{{transaction_id}}str_pad(transaction.id, 12, '0', STR_PAD_LEFT)Text, minimum twelve digits; preserve larger IDs without truncation/JS numeric coercion. Same display in subject and attachment name.
{{transaction_date}}Carbon::parse(transaction.created_at)->toDateTimeString()Original creation timestamp/timezone semantics; not transaction.date.
{{transaction_description}}transaction.description ?? 'N/A'Escaped text, required row. Null becomes N/A; empty string and string 0 remain unchanged. No rich-text conversion/raw HTML.
{{transaction_type}}transaction.typeOriginal debit/credit string. Do not infer a refund, settlement or new payment state.
{{transaction_amount}}transaction.business.currency.code . number_format(transaction.amount, 2)Full original display, preserving sign and zero. Not transaction.currency, FX value or customer balance.
{{app_name}}config('app.name')Original Thanks sign-off.
{{preheader}}Suggested summary aboveEscaped text; no new business claims.

The default Built logo is already concrete HTTPS; optional {{logo_url}} override and footer badges follow [shared-footer](../shared-footer.md). All business fields above remain required; no optional description wrapper should be removed.

Recipients, headers, queue and PDF

sendEmail scopes transaction by current business and ID, eagerly loads business, owner, currency and customer. It combines comma-split request.other_emails with truthy customer.business_email, applies array_unique/array_filter and calls Mail::to(emails)->queue(new DepositTransaction(transaction)) only for a nonempty result. It does not trim or validate each address there; keep target authorization/validation decisions separate. Preserve existing missing-customer/error behavior, not a guessed fallback recipient.

From uses config(mail.from.address) with business.name; Reply-To business.email ?: business.owner.email with business.name. Keep these headers and queue(), including any underlying transport/outbox. Subject uses the padded ID.

Preserve SnappyPdf::loadView('deposit-transactions.receipt', ['transaction' => transaction]) and attachData(pdf.output(), 'deposit_transaction_#' + padded ID + '.pdf'). No explicit MIME override is passed. That PDF separately uses business/customer fields and SignatureRepository::deposit_reciept(business_id); it is outside this HTML redesign. Do not replace the PDF with the email or invoke generation for previews.

The SMS print URL /deposit-transactions/receipt/print/{uuid} is a separate channel and is not supplied as an email action. The draft remains informational and explicitly retains the attachment instruction. Six states cover credit/debit, null/empty/0 description, zero amount and long values.

Integration and safety

Prefer this Mailable with a complete HTML Blade view and separately registered text view. Portable {{placeholder_name}} values are not automatically Blade expressions. Escape text/attributes; if replacing strings, use one pass. Validate logo HTTPS/CID overrides separately. There is no transactional URL, legacy duplicate link or optional business section to invent. Shared footer images need actual CID embedding or approved absolute HTTPS hosting.

Files: public/ready/deposit-transaction-receipt.html and .txt; previews/deposit-transaction-receipt-*.html/.txt. No separate project-owned plain-text alternative was found; the new text is a proposed equivalent. Browser rendering does not prove PDF/CID delivery, Gmail/Outlook/iOS Mail compatibility or production delivery.