Add AI synopsis to new company domain signup emails - #504
Closed
shanerbaner82 wants to merge 1 commit into
Closed
Conversation
Enrich the accounts@ notification with a soft-failing 30–50 word Anthropic synopsis (company + person) generated off the web request via the existing queued notification, using a site excerpt plus Laravel AI Haiku agent.
Contributor
Author
|
Closing — Shane wants this on Bifrost only, not nativephp.com. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NewCompanyDomainRegisteredmail toaccounts@nativephp.comnow optionally includes a Synopsis: line (30–50 words) covering what the company does and who the person is.toMail), so signup stays fast. It fetcheshttps://{domain}(short timeout, HTML stripped to a text excerpt), then prompts an Anthropic Haiku agent via Laravel AI (CompanyDomainAnalyst).How it works
NotifyAccountsOfNewCompanyDomainunchanged (consumer skip + first-user-only).NewCompanyDomainRegistered::toMail()callsCompanyDomainSynopsisGenerator.CompanyDomainAnalyst::make()->prompt(...).Config / prod
config/ai.php(laravel/ai). Anthropic key viaANTHROPIC_API_KEY.ANTHROPIC_API_KEY=to.env.example.ANTHROPIC_API_KEYset (same as Bifrost). Without it, synopsis soft-fails and the basic email still goes out.laravel/aiv0.1.5, so the agent uses#[Provider('anthropic')](string). Bifrost’s newer SDK acceptsLab::Anthropic/HasProviderOptionsfor disabling thinking; that API is not available here yet.Tests
NewCompanyDomainRegistrationTest: synopsis included on success (Http + AI faked); email still sent when AI throws; gmail still skipped; first/second user behavior unchanged../vendor/bin/phpunit --filter NewCompanyDomainRegistrationTest— 5 passed.Test plan
ANTHROPIC_API_KEY