A comprehensive collection of React Email templates for the Azodik platform, featuring internationalization support and modern design patterns.
@azodik/templates is a powerful React Email template library designed to simplify email creation for modern applications. Built with TypeScript and Zod validation, it provides a robust foundation for creating beautiful, responsive emails that work across all email clients.
The library includes pre-built templates for common use cases like user onboarding, security notifications, and marketing communications. Each template is fully customizable and supports multiple languages out of the box.
Beautiful, responsive email templates built with React Email
Support for English, Hindi, Spanish, French, and German
Fully typed with Zod schemas for validation
Mobile-first approach for all email clients
Covers common use cases and business scenarios
Simple API for rendering templates with variables
Install the package using your preferred package manager:
# Using npm npm install @azodik/templates # Using yarn yarn add @azodik/templates # Using pnpm pnpm add @azodik/templates
This package requires the following peer dependencies:
Here's a simple example of how to use the templates:
import { getTemplate, getSubject } from '@azodik/templates'; // Render a welcome email const html = await getTemplate({ template: 'welcome', variables: { name: 'John Doe', url: 'https://example.com', plan: 'Pro', region: 'US', nextBillingDate: '2024-01-15' }, lang: 'en', appInfo: { name: 'MyApp', logo: 'https://example.com/logo.png', privacyPolicyUrl: 'https://example.com/privacy', termsOfServiceUrl: 'https://example.com/terms', cookiePolicyUrl: 'https://example.com/cookies', address: '123 Main St', city: 'New York', state: 'NY', zip: '10001', country: 'USA' } }); // Get the email subject const subject = getSubject('welcome', 'en');
Below is a comprehensive overview of all available templates, their use cases, and required data:
User registration, account creation, subscription activation
Email verification, account activation, security confirmation
Forgot password, password recovery, security reset
Password change confirmation, security notification
Profile change confirmation, account update notification
New login detection, security alerts, suspicious activity
Email change confirmation, account update notification
Phone number change confirmation, account update notification
Newsletter distribution, marketing campaigns, product updates
Renders an email template with the provided options.
Parameter | Type | Required | Description |
---|---|---|---|
template | EmailTemplate | Yes | The template type to render |
variables | TemplateVariables | Yes | Template-specific variables |
lang | TemplateLanguage | No | Language code (defaults to 'en') |
appInfo | AppInfo | Yes | Application information object |
Promise<string> - HTML string of the rendered email
Gets the localized subject line for a template.
Parameter | Type | Required | Description |
---|---|---|---|
template | EmailTemplate | Yes | The template type |
lang | TemplateLanguage | No | Language code (defaults to 'en') |
string - Localized subject line
The appInfo
object contains comprehensive information about your application
for branding and compliance purposes.
Field | Type | Description |
---|---|---|
name | string | Your application name |
logo | string (URL) | URL to your application logo |
privacyPolicyUrl | string (URL) | URL to your privacy policy |
termsOfServiceUrl | string (URL) | URL to your terms of service |
cookiePolicyUrl | string (URL) | URL to your cookie policy |
address | string | Street address |
city | string | City name |
state | string | State/province |
country | string | Country name |
zip | string | ZIP/postal code |
Field | Type | Default | Description |
---|---|---|---|
primaryColor | string | - | Primary brand color (hex code) |
secondaryColor | string | - | Secondary brand color (hex code) |
logoWidth | number | 100 | Logo width in pixels |
logoHeight | number | 100 | Logo height in pixels |
language | string | 'en' | Default language code |
theme | string | 'light' | Theme preference |
supportUrl | string (URL) | - | Customer support URL |
githubUrl | string (URL) | - | GitHub repository URL |
xUrl | string (URL) | - | X (Twitter) profile URL |
// Example AppInfo object const appInfo = { name: 'MyAwesomeApp', logo: 'https://example.com/logo.png', privacyPolicyUrl: 'https://example.com/privacy', termsOfServiceUrl: 'https://example.com/terms', cookiePolicyUrl: 'https://example.com/cookies', address: '123 Innovation Street', city: 'Tech City', state: 'CA', country: 'USA', zip: '90210', primaryColor: '#667eea', secondaryColor: '#764ba2', logoWidth: 120, logoHeight: 60, supportUrl: 'https://example.com/support', githubUrl: 'https://github.com/myapp', xUrl: 'https://x.com/myapp' };
Note: The fullAddress
field is automatically generated by
combining address components.
import { getTemplate } from '@azodik/templates'; const welcomeEmail = await getTemplate({ template: 'welcome', variables: { name: 'Alice Johnson', url: 'https://myapp.com/dashboard', plan: 'Enterprise', region: 'Europe', nextBillingDate: '2024-02-15' }, lang: 'en', appInfo: { name: 'MyApp', logo: 'https://myapp.com/logo.png', privacyPolicyUrl: 'https://myapp.com/privacy', termsOfServiceUrl: 'https://myapp.com/terms', cookiePolicyUrl: 'https://myapp.com/cookies', address: '456 Business Ave', city: 'London', state: 'England', country: 'UK', zip: 'SW1A 1AA' } });
import { getTemplate } from '@azodik/templates'; const loginAlert = await getTemplate({ template: 'login-alert', variables: { name: 'Bob Smith', url: 'https://myapp.com/security', loginTime: '2024-01-15T10:30:00Z', ipAddress: '192.168.1.100', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' }, lang: 'en', appInfo: { name: 'MyApp', logo: 'https://myapp.com/logo.png', privacyPolicyUrl: 'https://myapp.com/privacy', termsOfServiceUrl: 'https://myapp.com/terms', cookiePolicyUrl: 'https://myapp.com/cookies', address: '456 Business Ave', city: 'London', state: 'England', country: 'UK', zip: 'SW1A 1AA' } });
import { getTemplate } from '@azodik/templates'; const newsletter = await getTemplate({ template: 'marketing-newsletter', variables: { name: 'Carol Davis', userEmail: 'carol@example.com', newsletterLink: 'https://myapp.com/newsletter/123', unsubscribeLink: 'https://myapp.com/unsubscribe?token=abc123', managePreferencesLink: 'https://myapp.com/preferences' }, lang: 'en', appInfo: { name: 'MyApp', logo: 'https://myapp.com/logo.png', privacyPolicyUrl: 'https://myapp.com/privacy', termsOfServiceUrl: 'https://myapp.com/terms', cookiePolicyUrl: 'https://myapp.com/cookies', address: '456 Business Ave', city: 'London', state: 'England', country: 'UK', zip: 'SW1A 1AA' } });