-- ============================================ -- TEMPLATE-SAAS: Production Seeds - Notification Templates -- Version: 1.0.0 -- ============================================ INSERT INTO notifications.templates (id, code, name, description, category, channel, subject, body, body_html, variables) VALUES -- Welcome email ( 'b0000001-0000-0000-0000-000000000001', 'welcome_email', 'Welcome Email', 'Sent when a new user registers', 'transactional', 'email', 'Welcome to {{company_name}}!', 'Hi {{user_name}}, Welcome to {{company_name}}! We''re excited to have you on board. Your account has been created successfully. Here''s what you can do next: 1. Complete your profile 2. Explore the dashboard 3. Invite your team members If you have any questions, feel free to reach out to our support team. Best regards, The {{company_name}} Team', '
Hi {{user_name}},
Welcome to {{company_name}}! We''re excited to have you on board.
Your account has been created successfully. Here''s what you can do next:
If you have any questions, feel free to reach out to our support team.
Best regards,
The {{company_name}} Team
Hi {{user_name}},
Please verify your email address by clicking the button below:
This link will expire in {{expiry_hours}} hours.
If you didn''t create an account, you can safely ignore this email.
', '[{"name": "user_name", "required": true}, {"name": "verification_link", "required": true}, {"name": "expiry_hours", "required": true, "default": "24"}, {"name": "company_name", "required": true, "default": "Template SaaS"}]' ), -- Password reset ( 'b0000001-0000-0000-0000-000000000003', 'password_reset', 'Password Reset', 'Sent when user requests password reset', 'transactional', 'email', 'Reset your password', 'Hi {{user_name}}, We received a request to reset your password. Click the link below to set a new password: {{reset_link}} This link will expire in {{expiry_hours}} hours. If you didn''t request this, you can safely ignore this email. Your password will not be changed. Best regards, The {{company_name}} Team', 'Hi {{user_name}},
We received a request to reset your password. Click the button below to set a new password:
This link will expire in {{expiry_hours}} hours.
If you didn''t request this, you can safely ignore this email.
', '[{"name": "user_name", "required": true}, {"name": "reset_link", "required": true}, {"name": "expiry_hours", "required": true, "default": "1"}, {"name": "company_name", "required": true, "default": "Template SaaS"}]' ), -- User invitation ( 'b0000001-0000-0000-0000-000000000004', 'user_invitation', 'User Invitation', 'Sent when inviting a new team member', 'transactional', 'email', 'You''ve been invited to join {{tenant_name}}', 'Hi, {{inviter_name}} has invited you to join {{tenant_name}} on {{company_name}}. Click the link below to accept the invitation and create your account: {{invitation_link}} This invitation will expire in {{expiry_days}} days. Best regards, The {{company_name}} Team', '{{inviter_name}} has invited you to join {{tenant_name}} on {{company_name}}.
This invitation will expire in {{expiry_days}} days.
', '[{"name": "inviter_name", "required": true}, {"name": "tenant_name", "required": true}, {"name": "invitation_link", "required": true}, {"name": "expiry_days", "required": true, "default": "7"}, {"name": "company_name", "required": true, "default": "Template SaaS"}]' ), -- Invoice paid ( 'b0000001-0000-0000-0000-000000000005', 'invoice_paid', 'Invoice Paid', 'Sent when an invoice is paid', 'transactional', 'email', 'Payment received - Invoice #{{invoice_number}}', 'Hi {{user_name}}, We''ve received your payment for invoice #{{invoice_number}}. Amount: {{amount}} {{currency}} Date: {{payment_date}} You can download your receipt here: {{receipt_link}} Thank you for your business! Best regards, The {{company_name}} Team', 'Hi {{user_name}},
We''ve received your payment for invoice #{{invoice_number}}.
| Amount: | {{amount}} {{currency}} |
| Date: | {{payment_date}} |
Thank you for your business!
', '[{"name": "user_name", "required": true}, {"name": "invoice_number", "required": true}, {"name": "amount", "required": true}, {"name": "currency", "required": true, "default": "USD"}, {"name": "payment_date", "required": true}, {"name": "receipt_link", "required": true}, {"name": "company_name", "required": true, "default": "Template SaaS"}]' ), -- Trial ending soon ( 'b0000001-0000-0000-0000-000000000006', 'trial_ending', 'Trial Ending Soon', 'Sent when trial is about to end', 'transactional', 'email', 'Your trial ends in {{days_left}} days', 'Hi {{user_name}}, Your free trial of {{company_name}} ends in {{days_left}} days. To continue using all features without interruption, please add a payment method and choose a plan. {{upgrade_link}} If you have any questions, our team is here to help! Best regards, The {{company_name}} Team', 'Hi {{user_name}},
Your free trial of {{company_name}} ends in {{days_left}} days.
To continue using all features without interruption, please add a payment method and choose a plan.
', '[{"name": "user_name", "required": true}, {"name": "days_left", "required": true}, {"name": "upgrade_link", "required": true}, {"name": "company_name", "required": true, "default": "Template SaaS"}]' ) ON CONFLICT (code) DO UPDATE SET name = EXCLUDED.name, subject = EXCLUDED.subject, body = EXCLUDED.body, body_html = EXCLUDED.body_html, updated_at = NOW(); -- Comments COMMENT ON TABLE notifications.templates IS 'Email and notification templates';