BuiltEmail workspace

Affiliate invitation

Source: App\Mail\AffiliateInvite, app/Mail/AffiliateInvite.php, resources/views/emails/AffiliateInvite.blade.php (preserve case). Original components: mail::message, mail::button, mail::subcopy and mail::panel. Static references establish usage, not current production delivery.

Subject: {{affiliate_name}} invites you to use Built for free (existing exact pattern).

Suggested preheader: {{affiliate_name}} invites you to Built: Enterprise free for one month.

Required portable values

TokenExisting source / derivationHandling
{{affiliate_name}}account.name from getAccount()Escaped inviter identity in subject/heading/preheader. Not recipient name or an unrelated business.
{{referral_url}}'https://affiliate.builtaccounting.com/' . account.codeRequired complete original referral signup URL, preserving text code/case/leading zeros. Button and fallback use the same value. Validate approved HTTPS host/path separately, then escape attributes/text.
{{features_url}}Fixed https://builtaccounting.com/features/Existing Read More destination, now Explore Built features. Separate secondary website link, not referral signup.
{{built_site_url}}Fixed https://built.africaExisting full-feature-list destination, retained separately from features_url.
{{app_name}}config('app.name')Escaped original Regards sign-off.
{{preheader}}Suggested inviter/one-month summary aboveEscaped text; duration is baseline content, not an invented expiry.

Default HTTPS logo/optional {{logo_url}} and shared badge CID/HTTPS requirements: [shared-footer](../shared-footer.md). No optional business section exists. Required missing account/name/code needs an explicit target-project decision, not a fabricated inviter/link. The full URL maps account.code without adding a redundant displayed token.

Trigger, recipient and queue

AffiliateAccountController::sendinvite, app/Http/Controllers/Account/AffiliateAccountController.php:202–211, gets the affiliate account for the authenticated API user, then calls Mail::to(request.email)->queue(new AffiliateInvite(getAccount())) at :205. It creates the separate App\AffiliateInvite tracking record afterward, calling getAccount() again for account_id. This method does not itself validate each email or guard a missing affiliate account. Preserve native route/authentication/error behavior and call ordering; do not add acceptance/expiry checks or tracking writes through a template redesign.

routes/api.php registers sendaffiliateinvite POST around :1240 and :1477. Preserve the source queue() invocation. No explicit From/Reply-To override, PDF or business attachment is configured; keep configured headers and underlying transport/outbox. Request-selected referral recipient is distinct from the affiliate account's email. The body is API-owned, even though its signup destination is external. External CRM campaigns remain excluded.

Offer, feature summary and destinations

The source explicitly offers the Enterprise package free for 1 month. The draft preserves that as “Enterprise package free for one month.” No new deadline, eligibility condition, permanent-free promise, billing requirement, fee, commission or acceptance status is invented. This Mailable does not enforce the offer, and the external signup application's current eligibility/redemption behavior was not established here. Confirm campaign eligibility in a separately reviewed production integration; do not silently change the native subject or offer through layout.

Two original Sign Up Now buttons and a trailing referral URL all use the same source host/code. The draft uses one Sign up for Built button plus a visible fallback, mapped to one referral_url. No legacy duplicate link fields need independent values. Explain that it opens the affiliate signup site, rather than an in-app review or dashboard.

All ten source feature categories remain: branded invoices, quotes/estimates, online payments, bills, salary payments, vendor payments, expenses, multiple users, VAT reports and POS/inventory. The original bills description duplicates the quote copy and expenses duplicates salary copy; the draft keeps those actual feature labels instead of misleading duplicated instructions. Online-payment “settled instantly” and vendor/speed promises are omitted; no processing/settlement guarantees are added. Existing one-click salary functionality wording remains without a delivery-time promise. Both original informational website destinations remain separate secondary links.

The config(app.url)/img/built.jpeg product screenshot and decorative feature icons are replaced by text; retain original API assets unchanged. The approved logo/shared footer remain. No tracking pixel, new external stylesheet or browser layout dependency is introduced.

Integration and safety

Use this Mailable with a complete HTML Blade view and proposed plain-text alternative. Portable {{placeholder_name}} tokens are not automatically Blade. Escape all dynamic values/attributes; validate referral/site URLs separately against their approved hosts/paths, plus logo/CID rules. Use one pass for replacements. Neither signup code nor inviter text is trusted raw HTML. No preview controls/scripts or local action URLs belong in production.

Three fictional states cover normal referral, supplied code 0 as a mapping check and long values. Files: public/ready/affiliate-invitation.html/.txt and previews/affiliate-invitation-*.html/.txt. No separate project-owned plain-text source found. Browser checks do not verify offer redemption, external affiliate behavior, actual email-client compatibility, image delivery or production sending.