Email workspaceOverdraft request — internal finance
Source: App\Mail\OverdraftRequestMail, app/Mail/OverdraftRequestMail.php; resources/views/emails/overdraftRequest.blade.php using mail::message. The native subject is explicitly set across a chained line: Overdraft request from {{business_name}} for bill {{bill_number}}. This corrects the earlier automated catalog inference of a class-derived subject. Suggested preheader: the same existing business/bill request summary.
Required and conditional portable values
| Token | Existing source / derivation | Handling |
|---|---|---|
| {{business_name}} | business.name | Required escaped business label and subject component. |
| {{business_address}} | business.address ?? 'Not available' | Required row, null-only fallback; preserve empty string/0. |
| {{business_phone}} | business.phone_number ?? 'Not available' | Same original null-only fallback. |
| {{vendor_account_name}} | request.account_name (OverdraftRequest) | Required escaped vendor bank/mobile-money account name. |
| {{vendor_account_number}} | request.account_number | Required original value kept as text/leading zeros; not wallet/account ID. Source request validation is numeric, but formatting must not coerce an already stored identifier again. |
| {{vendor_bank}} | request.bank | Required original bank/network text. |
| {{request_amount}} | bill.fx_currency . number_format(request.amount, 2) | Required full original display, retaining sign/zero. |
| {{interest_amount}} | bill.fx_currency . number_format(request.interest, 2) | Required supplied interest amount, not a calculated rate. |
| {{total_amount}} | bill.fx_currency . number_format(request.total_amount, 2) | Required supplied total, not recalculated from other email fields. |
| {{repayment_period}} | request.repayment_period plus source Days unit | Required complete display; proposed spacing/case is “30 days” rather than “30Days”. Retain original period and unit; do not calculate a new date. |
| {{repayment_due_date}} | request.repayment_due_date | Required original display/semantics; no new timezone or date derivation. |
| {{bill_amount_due}} | bill.fx_currency . number_format(bill.amount_left, 2) | Required amount_left, distinct from bill total and request total. |
| {{bill_number}} | bill.bill_id | Required original bill display and subject, not database ID/UUID. |
| {{bill_url}} | FinanceRepository-supplied link = config('app.url') . '/printbill/' . encrypt(bill.id) | Required complete source URL. Preserve encrypted value; validate approved HTTPS app/print path separately. Do not re-encrypt in HTML or substitute another identifier/path. |
| {{wallet_number}} | wallet.number | Optional only with original Wallet object present. String/leading zeros remain. |
| {{wallet_balance}} | wallet.currency . number_format(wallet.balance, 2) | Same object condition; independent currency, zero/sign retained. |
| {{app_name}} | config('app.name') | Required original Thanks sign-off. |
| {{preheader}} | Source business/bill summary above | Required escaped text, no approval/disbursement claim. |
Default logo/optional {{logo_url}} and shared footer CID/approved HTTPS assets: [shared-footer](../shared-footer.md). All request/vendor/business/bill fields remain required. Missing values need an explicit target-project decision, not fabricated repayment/account/amount data. Never use real banking/repayment records for design fixtures.
Optional wallet and action meaning
The marked optional wallet section in HTML/text is retained only if the source Wallet object exists. Zero balance still renders. Remove its whole caption/table/text block if absent. Preview wallet_visible is an adapter flag, not a new printed token/application field. The remaining request and bill action never depend on wallet balance.
View bill opens the original print page; visible fallback shares bill_url. It reviews the supplied bill and does not approve or initiate payment. The native email prints the supplied link even when the separate FundRequest payload has a different route('print.bill', bill.enc_id) print_link. Do not collapse those destinations or rederive from enc_id, UUID, /expenses/ or the partner request URL. No legacy duplicate email link fields exist beyond button/fallback repetition.
Caller, recipients and native behavior
billsController::RequestOverDraft (:1839–1862), route POST overdraft/request at routes/api.php:594, validates bill/service, account, amount/interest/total and repayment fields, sets current business_id and calls FinanceRepository::SendOverDraft. Keep its exact validation/ownership/error behavior; a template does not authorize stronger/weaker API rules or finance changes.
FinanceRepository::SendOverDraft (:19–90) saves OverdraftRequest, creates separate FundRequest/PartnerBusinessReference records, resolves Business/Bill, business-owner User and first Wallet by business_id, builds the encrypted bill print link and calls send(new OverdraftRequestMail(data)) to the fixed internal finance recipient. Source request in the view is OverdraftRequest, not FundRequest or the HTTP request.
Reply-To is the business owner's user.email. From uses native configured sender with no explicit override; no CC/BCC is added by the Mailable. Preserve internal To, the explicit business/bill subject, send() and underlying transport/outbox policy. No business PDF or email attachment exists. Vendor account and wallet details intentionally serve the internal finance audience, not a customer receipt or general applicant acknowledgement.
Native integration and safety
Use the existing Mailable with a complete HTML Blade view and proposed plain-text alternative. Portable {{placeholder_name}} values are not automatically Blade variables. Escape text/attributes, validate the original encrypted bill/image URLs separately, use one pass if replacing strings and retain native optional conditions. No framework, financial arithmetic, new deadline, interest rate, bank guarantee, approval status or provider call belongs in this redesign.
Four fictional states cover wallet present, wallet absent/null fallbacks, supplied zero/empty values and long fields/links/identifiers. Files: public/ready/overdraft-request.html/.txt and previews/overdraft-request-*.html/.txt. No separate project-owned plain-text source found. Browser checks do not validate account numbers, repayment eligibility, encrypted route authorization, actual Gmail/Outlook/iOS Mail, CID delivery or production sending.