Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspfox.com/llms.txt

Use this file to discover all available pages before exploring further.

AspFox sends transactional email via Resend. All 12 email templates are already written — you configure the API key and sending address.

Local development

Create a Resend account and API key

  1. Sign up at resend.com
  2. Go to API KeysCreate API Key
  3. Add to .env: RESEND_API_KEY=re_…

Use the shared onboarding address

Without a verified domain, use onboarding@resend.dev as your FROM address. Resend allows all accounts to send from this address for testing.
EMAIL_FROM_ADDRESS=onboarding@resend.dev
EMAIL_FROM_NAME=Acme
Every email you send appears in the Emails section of the Resend dashboard with delivery status, the full rendered HTML, and bounce/open tracking.
With onboarding@resend.dev, emails can only be sent to the email address that owns the Resend account. To send to other addresses during development, you need to verify a domain.

Production

Verify your sending domain

  1. Resend Dashboard → DomainsAdd Domain
  2. Enter your domain (e.g., yourdomain.com)
  3. Add the DNS records Resend provides (DKIM, SPF, DMARC)
  4. Wait for verification (usually minutes; up to 24 hours)

Update your sending address

EMAIL_FROM_ADDRESS=noreply@yourdomain.com
EMAIL_FROM_NAME=Acme

Email templates

AspFox includes 12 pre-built HTML templates. All use inline styles for email client compatibility.
TemplateWhen it is sent
WelcomeAfter email verification is complete
EmailVerificationAfter registration — contains the verification link
PasswordResetAfter requesting a password reset
MagicLinkAfter requesting a magic link login
PasswordChangedConfirmation after a successful password change
TenantInvitationWhen a user is invited to a workspace
TrialExpiry7Day7 days before trial expiration (sent by TrialExpiryJob)
TrialExpiry1Day1 day before trial expiration (sent by TrialExpiryJob)
PaymentFailedWhen invoice.payment_failed webhook is received
PaymentRecoveredWhen payment succeeds after a past-due period
CancellationScheduledWhen subscription is set to cancel at period end
CancellationConfirmedWhen subscription is fully canceled
Template classes live in src/YourProject.Infrastructure/Email/Templates/. Each extends EmailTemplateBase and implements RenderContent() to return the email body HTML.

Testing email rendering locally

To preview a template without sending it:
// Temporary code in a test or scratch endpoint:
var template = new EmailVerificationTemplate(
    userName: "Jane",
    verificationUrl: "http://localhost:5173/verify-email?token=test"
);
var html = template.Render();
await File.WriteAllTextAsync("/tmp/email-preview.html", html);
Then open /tmp/email-preview.html in a browser to see the rendered template. Delete the temporary code afterward.