Email Notifications
Email notifications are sent for key account and organization events. Each notification uses a customizable template that can be edited from the admin panel.
Notification Classes
The following notifications are delivered via email:
WelcomeNotification— sent after registrationMfaStatusNotification— sent when MFA is enabled or disabledApiKeyCreatedNotification— sent when a new API key is generatedInvitationNotification— sent to invited users with a join linkMemberJoinedNotification— sent to org admins when a new member joinsPasswordChangedNotification— sent when the user changes their passwordPaymentFailedNotification— sent when a Stripe payment failsSubscriptionActivatedNotification— sent when a subscription starts or renewsSubscriptionCancelledNotification— sent when a subscription is cancelled
UsesEmailTemplate Trait
All email notifications use the UsesEmailTemplate trait. This trait:
- Loads the corresponding
EmailTemplaterecord from the database by template slug - Renders the template body with variable substitution (e.g.
{name},{org_name}) - Falls back to a default template if no custom template exists
class WelcomeNotification extends Notification
{
use UsesEmailTemplate;
protected $templateSlug = 'welcome';
public function toMail($notifiable)
{
return $this->buildMailFromTemplate($notifiable, [
'name' => $notifiable->name,
'email' => $notifiable->email,
]);
}
}
TemplateMail Class
The TemplateMail class is a Mailable that renders the final email using the template's subject, body, and layout. It handles variable interpolation and wraps the content in the application's email layout.
Mail Drivers
LaunchKit supports multiple mail drivers, switchable from the admin panel without code changes:
- SMTP — standard SMTP server
- Mailgun — via Mailgun API
- Postmark — via Postmark API
- Resend — via Resend API
- SES — via Amazon Simple Email Service
MailConfigService
The MailConfigService loads mail configuration from the database at runtime, allowing admins to change the mail driver, credentials, and sender details without editing .env or config files. Settings are applied on each request via the service provider.