@trovyx/razon 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +287 -559
  2. package/bin/index.js +1 -1
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,639 +1,367 @@
1
- # Razon - Advanced CLI Email Client
1
+ # Razon
2
2
 
3
- A cutting-edge, enterprise-grade email automation platform developed by the **Razon Team**. Razon delivers unparalleled performance for bulk email campaigns, marketing automation, and professional email management with advanced templating, multi-provider support, and intelligent delivery optimization.
4
-
5
- ## Features
6
-
7
- ### 🚀 **Core Email Engine**
8
- - **Multi-Provider SMTP Support**: Seamlessly integrate with unlimited SMTP providers including Gmail, Outlook, SendGrid, Mailgun, Amazon SES, and custom servers
9
- - **Intelligent Failover System**: Automatic provider switching with health monitoring and performance optimization
10
- - **High-Performance Delivery**: Concurrent email processing with configurable parallel connections for maximum throughput
11
- - **Smart Rate Limiting**: Advanced throttling with hourly, daily, and per-minute limits to respect provider constraints
12
-
13
- ### 📧 **Advanced Email Composition**
14
- - **Dynamic Template Engine**: Powerful HTML templating with 50+ built-in variables and custom tag support
15
- - **Multi-Format Attachments**: Support for PDF, HTML, Images (PNG/JPG), SVG, and EML files with dynamic generation
16
- - **Intelligent Content Processing**: Automatic image embedding, CSS inlining, and mobile-responsive optimization
17
- - **Personalization Engine**: Real-time content customization with fake data generation and company lookup integration
18
-
19
- ### 🎯 **Campaign Management**
20
- - **Bulk Email Processing**: Efficient batch processing with BCC, CC, and TO distribution modes
21
- - **Test Mode Environment**: Safe testing with isolated recipient lists and comprehensive validation
22
- - **Campaign Analytics**: Real-time delivery tracking, bounce handling, and performance metrics
23
- - **Recipient Management**: CSV/TXT file support with advanced parsing and validation
24
-
25
- ### 🔒 **Security & Privacy**
26
- - **Proxy Integration**: Full SOCKS5/HTTP proxy support for enhanced privacy and geographic distribution
27
- - **Secure Authentication**: OAuth2, API key, and traditional SMTP authentication methods
28
- - **Encrypted Attachments**: Password-protected PDF generation and secure file handling
29
- - **Audit Logging**: Comprehensive security logs with configurable retention policies
30
-
31
- ### 🌐 **Enterprise Integration**
32
- - **Outlook Web Access (OWA)**: Native support for Office 365 and Exchange Online accounts
33
- - **Hunter.io Integration**: Automatic company name resolution and email verification
34
- - **API-First Design**: RESTful endpoints for seamless integration with existing systems
35
- - **CLI Interface**: Powerful command-line tools for automation and scripting
36
-
37
- ### 📊 **Monitoring & Analytics**
38
- - **Real-Time Logging**: Multi-level logging with JSON, text, and structured formats
39
- - **Performance Metrics**: Delivery rates, response times, and provider performance analytics
40
- - **Error Handling**: Intelligent retry mechanisms with exponential backoff and dead letter queues
41
- - **Health Monitoring**: System health checks and automated alerting
3
+ Advanced CLI email client with multi-provider support, dynamic templating, and intelligent delivery optimization.
42
4
 
43
5
  ## Installation
44
6
 
45
- ### Prerequisites
46
- - Modern runtime environment
47
- - Version control system
48
- - Administrative privileges for installation
7
+ ```bash
8
+ npm install -g @trovyx/razon
9
+ ```
49
10
 
50
- ### Quick Setup
11
+ ## Quick Start
51
12
 
52
- 1. **Clone the Razon repository**:
53
13
  ```bash
54
- git clone <repository-url>
55
- cd razon-email-client
14
+ # 1. Authenticate
15
+ razon login <your-access-token>
16
+
17
+ # 2. Create config files
18
+ razon init
19
+
20
+ # 3. Configure your SMTP/OWA settings
21
+ # Edit config/smtp.jsonc with your provider credentials
22
+
23
+ # 4. Send a test email
24
+ razon test
25
+
26
+ # 5. Send to all recipients
27
+ razon send
56
28
  ```
57
29
 
58
- 2. **Install dependencies**:
30
+ ## Features
31
+
32
+ - **Multi-Provider SMTP** - Unlimited SMTP accounts with automatic failover and load balancing
33
+ - **Outlook Web Access (OWA)** - Native Office 365 and Exchange Online support
34
+ - **Dynamic Templates** - 50+ built-in tags for personalized HTML emails
35
+ - **Attachments** - PDF, HTML, images (PNG/JPG), SVG, and EML with dynamic generation
36
+ - **Password-Protected PDFs** - Generate encrypted PDF attachments on the fly
37
+ - **Calendar Invites** - Attach .ics invites for Teams, Google Meet, Zoom, or custom events
38
+ - **DKIM Signing** - Generate DKIM keys for improved inbox delivery
39
+ - **Bulk & Batch Sending** - BCC, CC, and TO distribution modes with configurable batch sizes
40
+ - **Smart Rate Limiting** - Hourly, daily, and per-minute throttling per provider
41
+ - **Proxy Support** - SOCKS5 and HTTP proxies for geographic distribution
42
+ - **Parallel Connections** - Concurrent email processing for maximum throughput
43
+ - **Contact Enrichment** - Company name and logo lookup via Hunter.io
44
+ - **Asset Caching** - Pre-generate PDFs, SVGs, and images before sending
45
+ - **Custom Tags** - Define per-recipient variables from CSV/Excel columns
46
+ - **Database Tracking** - Track sent emails, prevent duplicates, backup and restore
47
+ - **Device Auth** - Multi-device authentication with PIN and security questions
48
+
49
+ ## Commands
50
+
51
+ ### Sending
52
+
59
53
  ```bash
60
- # Install required dependencies
61
- npm install
54
+ razon send # Send to all recipients
55
+ razon send 100 # Send to first 100 recipients
56
+ razon send -f # Force re-send to already-sent recipients
57
+ razon send --throttle --delay 10 # Throttle with 10s delay between batches
58
+ razon send --email-before-sleep 500 # Send 500 emails per batch
59
+ razon send --randomize-servers # Randomize SMTP server selection
60
+ razon send --test-between # Insert test emails during campaign
61
+ razon send --email-before-test 200 # Send test email every 200 emails
62
62
  ```
63
63
 
64
- 3. **Initialize configuration**:
64
+ ### Testing
65
+
65
66
  ```bash
66
- # Copy example configurations
67
- cp config/core.jsonc.example config/core.jsonc
68
- cp config/smtp.jsonc.example config/smtp.jsonc
69
- cp config/message.jsonc.example config/message.jsonc
67
+ razon test # Send test emails (default: 5)
68
+ razon test 10 # Send 10 test emails
70
69
  ```
71
70
 
72
- 4. **Build the project**:
71
+ ### Asset Caching
72
+
73
73
  ```bash
74
- # Build the application
75
- npm run build
74
+ razon cache-only # Cache email assets without sending
75
+ razon cache-only -f # Force regenerate cached assets
76
+ razon cache-only --template my-template # Cache specific template assets
77
+ razon cache-only --parallel 8 # Use 8 parallel threads
78
+ razon cache-only --clean # Remove existing assets before caching
79
+ razon cache-only --clear-only # Remove all cached assets
80
+ razon cache-only --clear-only my-template # Remove cache for specific template
76
81
  ```
77
82
 
78
- ### Docker Installation (Alternative)
83
+ ### Contact Enrichment
79
84
 
80
85
  ```bash
81
- # Pull the official Razon image
82
- docker pull razon/email-client:latest
86
+ razon cache leads.txt # Cache company names & logos
87
+ razon cache leads.csv -a ./api.txt # Specify Hunter.io API key file
88
+ razon cache leads.csv -s # Skip names, logos only
89
+ razon cache leads.csv -b 20 # Process 20 domains per batch
90
+
91
+ razon contacts leads.txt # Enrich file with company data
92
+ razon contacts data.csv -e 3 -c 5 # Email in col 3, company name to col 5
93
+ razon contacts leads.xlsx -m file # Download logo images to files
94
+ razon contacts data.csv --skip-logo # Company names only
95
+ razon contacts leads.csv -o xlsx # Force Excel output
96
+ ```
83
97
 
84
- # Run with volume mounting for configuration
85
- docker run -v $(pwd)/config:/app/config razon/email-client:latest
98
+ ### Email List Management
99
+
100
+ ```bash
101
+ razon remove-dup emails.txt # Remove duplicate emails
102
+ razon remove-bad emails.txt # Remove invalid emails
103
+ razon remove-bad emails.csv -t provider -d gmail.com,yahoo.com # Remove by provider
104
+ razon remove-non-unique new.txt # Remove emails already in database
105
+ razon remove-unique all.txt # Keep only emails in database
86
106
  ```
87
107
 
88
- ## Quick Start
108
+ ### Tags
109
+
110
+ ```bash
111
+ razon tags # Show available template tags
112
+ razon tags contacts.csv # Show tags from CSV/Excel columns
113
+ ```
89
114
 
90
- ### 🎯 **Getting Started in 5 Minutes**
91
-
92
- 1. **Configure Your Email Provider**:
93
- Edit `config/smtp.jsonc` with your SMTP server credentials:
94
- ```bash
95
- # Configure your email provider settings
96
- nano config/smtp.jsonc
97
- ```
98
-
99
- 2. **Design Your Email Campaign**:
100
- Configure `config/message.jsonc` with your email content and templates:
101
- ```bash
102
- # Set up your email template and content
103
- nano config/message.jsonc
104
- ```
105
-
106
- 3. **Prepare Your Recipient List**:
107
- Create a recipient file with email addresses:
108
- ```bash
109
- # Create recipients file (supports .txt and .csv)
110
- echo "recipient1@example.com" > recipients.txt
111
- echo "recipient2@example.com" >> recipients.txt
112
- ```
113
-
114
- 4. **Launch Your Campaign**:
115
- ```bash
116
- # Start Razon CLI
117
- npm start
118
-
119
- # Or run in test mode first
120
- npm run test-mode
121
- ```
122
-
123
- ### 🧪 **Test Mode (Recommended for First Run)**
124
-
125
- Before sending to real recipients, always test your configuration:
115
+ ### DKIM
126
116
 
127
117
  ```bash
128
- # Enable test mode in config/core.jsonc
129
- {
130
- "enableTestMode": true,
131
- "testLeadsFile": "test-recipients.txt",
132
- "testLeadsLimit": 5
133
- }
118
+ razon dkim yourdomain.com # Generate DKIM keys
119
+ razon dkim yourdomain.com -s myselector # Custom selector name
120
+ razon dkim yourdomain.com -o ./keys # Custom output directory
121
+ razon dkim # Show full DKIM help
122
+ ```
134
123
 
135
- # Create test recipients
136
- echo "test@yourdomain.com" > test-recipients.txt
124
+ ### Database & Backups
137
125
 
138
- # Run test campaign
139
- npm run test
126
+ ```bash
127
+ razon count-total # Show emails sent per provider
128
+ razon summary # Full system summary
129
+ razon summary --smtp # SMTP summary only
130
+ razon summary --owa # OWA summary only
131
+
132
+ razon backup # Create database backup
133
+ razon backup my-backup # Named backup
134
+ razon list-backups # List available backups
135
+ razon restore my-backup # Restore from backup
136
+ razon restore my-backup -c # Clear database before restore
137
+ razon clear --confirm # Clear entire database (irreversible)
140
138
  ```
141
139
 
142
- ### 📊 **Monitor Your Campaign**
140
+ ### Authentication
143
141
 
144
142
  ```bash
145
- # View real-time logs
146
- tail -f mailer.log
143
+ razon login <token> # Authenticate with access token
144
+ razon logout # Log out current device
145
+
146
+ razon auth list # List registered devices
147
+ razon auth device <id> # Show device details
148
+ razon auth pin # Change your PIN
149
+ razon auth reset-pin <token> # Reset PIN via security questions
150
+ razon auth add-security # Add a security question
151
+ ```
147
152
 
148
- # Check delivery status
149
- npm run status
153
+ ### System
150
154
 
151
- # View campaign analytics
152
- npm run analytics
155
+ ```bash
156
+ razon init # Create config files
157
+ razon init -f # Force overwrite existing config
158
+ razon install # Install Chromium for PDF/image generation
159
+ razon install-pdf # Install PDF conversion binary
160
+ razon check-update # Check for available updates
161
+ razon upgrade # Upgrade Razon to latest version
162
+ razon upgrade -f # Force reinstall
163
+ razon version # Show version
153
164
  ```
154
165
 
155
166
  ## Configuration
156
167
 
157
- Razon uses a modular JSONC configuration system that provides maximum flexibility and maintainability. All configuration files are located in the `config/` directory and support comments for better documentation.
168
+ Run `razon init` to generate all config files in a `config/` folder:
169
+
170
+ | File | Purpose |
171
+ | ----------------------- | ---------------------------------------------------------------- |
172
+ | `core.jsonc` | Global settings, test mode, proxy, parallel connections, logging |
173
+ | `smtp.jsonc` | SMTP provider accounts and rate limits |
174
+ | `message.jsonc` | Email subject, body, recipients, calendar invites |
175
+ | `attachments.jsonc` | PDF, image, HTML, SVG, and EML attachment settings |
176
+ | `addon/owa.jsonc` | Outlook Web Access accounts |
177
+ | `eml/attachments.jsonc` | EML-specific attachment settings |
178
+
179
+ All config files use JSONC format (JSON with comments).
180
+
181
+ ## Template Tags
182
+
183
+ Razon has 80+ built-in tags that resolve dynamically across every part of your email — subject, body, from name, attachment content, attachment filenames, EML headers, calendar invites, and disclaimer text. Tags work everywhere, automatically.
158
184
 
159
- ### 📁 **Configuration Structure**
185
+ ### How Tags Flow
186
+
187
+ Tags are resolved using a **multi-pass recursive engine**. If a tag resolves to a value that itself contains another tag, Razon resolves that too — up to 3 levels deep. This means tags can nest naturally without any special syntax.
188
+
189
+ Tags flow through every layer of your email:
160
190
 
161
191
  ```
162
- config/
163
- ├── core.jsonc # Core application settings and global preferences
164
- ├── smtp.jsonc # SMTP server configurations and provider settings
165
- ├── message.jsonc # Email message templates and content settings
166
- ├── attachments.jsonc # Attachment configurations and processing rules
167
- ├── addon/
168
- │ └── owa.jsonc # Outlook Web Access integration settings
169
- └── eml/
170
- └── attachments.jsonc # EML-specific attachment configurations
192
+ Subject → "Hello {FIRST_NAME}, your invoice {UNIQUE_ID}"
193
+ From Name → "{FAKE_FULL_NAME}"
194
+ Body HTML → All tags replaced, including {PDF_PASSWORD}
195
+ Attachment HTML → Tags replaced before converting to PDF/Image
196
+ Attachment Name → "Invoice_{UNIQUE_ID}.pdf"
197
+ EML Subject → Tags replaced independently
198
+ EML Headers → Custom headers with tags
199
+ EML Body → Full tag replacement inside nested email
200
+ Calendar Invite → Tags in title, description, attendee fields
171
201
  ```
172
202
 
173
- ### ⚙️ **Core Configuration (`config/core.jsonc`)**
203
+ A single `{PDF_PASSWORD}` generated in the body is automatically shared across all attachments and nested EML content in the same email — so the password in the body always matches the password on the PDF.
174
204
 
175
- The central configuration file that controls Razon's core functionality and global behavior:
205
+ ### Custom Tags from CSV/Excel (Highest Priority)
206
+
207
+ When using a CSV or Excel file as your recipient list, column headers automatically become tags. Custom tags are resolved **before** built-in tags, so you can override any built-in tag with per-recipient data.
176
208
 
177
- ```json
178
- {
179
- "name": "Razon Advanced Email Client",
180
- "enableTestMode": false,
181
- "testLeadsFile": "test-leads.txt",
182
- "testLeadsLimit": 5,
183
- "useBulkSending": false,
184
- "bulkSending": {
185
- "batchSize": 50,
186
- "useBccForSending": true,
187
- "useCcForSending": false,
188
- "useToForSending": false
189
- },
190
- "enableSleepBetweenEmails": false,
191
- "delayDurationInSeconds": 10,
192
- "emailsBeforeSleep": 1000,
193
- "randomizeEmailServers": true,
194
- "proxy": {
195
- "useProxy": false,
196
- "host": "localhost",
197
- "port": 8080,
198
- "user": "user",
199
- "pass": "pass",
200
- "protocol": "socks5",
201
- "useAuthentication": false
202
- },
203
- "parallel": {
204
- "parallelConnections": 10,
205
- "enableParallelSending": true
206
- },
207
- "logging": {
208
- "enabled": true,
209
- "level": "info",
210
- "logFile": "mailer.log",
211
- "format": "text",
212
- "logFailed": true,
213
- "logSuccess": true
214
- },
215
- "HUNTER_API_KEY": [
216
- "your-hunter-api-key"
217
- ]
218
- }
209
+ ```
210
+ CSV: Email, First Name, Company, Deal Size
211
+ → {FIRST_NAME}, {COMPANY}, {DEAL_SIZE}
219
212
  ```
220
213
 
221
- ### 📧 **SMTP Configuration (`config/smtp.jsonc`)**
214
+ Use `razon tags` to inspect available tags for your recipient file.
222
215
 
223
- Configure multiple email providers with intelligent load balancing and failover capabilities:
216
+ ### Built-in Tags
224
217
 
225
- ```json
226
- {
227
- "randomizeEmailServers": true,
228
- "accounts": [
229
- {
230
- "useMe": true,
231
- "host": "smtp.resend.com",
232
- "port": 587,
233
- "secure": false,
234
- "user": "resend",
235
- "pass": "your-api-key",
236
- "fromEmail": "campaigns@yourdomain.com",
237
- "fromName": "Your Campaign Name",
238
- "useAuth": true,
239
- "dailyLimit": 10000,
240
- "retryFailed": false,
241
- "retryCount": 2,
242
- "useProxy": false,
243
- "options": {
244
- "enableHourlyLimit": false,
245
- "sendPerHour": 100,
246
- "enableMinuteLimit": false,
247
- "sendPer10Minutes": 10
248
- },
249
- "advance": {
250
- "pool": false,
251
- "maxConnections": 5,
252
- "maxMessages": 100
253
- }
254
- }
255
- ]
256
- }
257
- ```
218
+ **Recipient & Domain**
258
219
 
259
- ### 📝 **Message Configuration (`config/message.jsonc`)**
220
+ | Tag | Output |
221
+ | --- | ------ |
222
+ | `{EMAIL_ADDRESS}` / `{EMAIL}` | Recipient's email |
223
+ | `{USERNAME}` | Local part of email |
224
+ | `{DOMAIN}` | Domain of email |
225
+ | `{COMPANY_NAME}` | Company name derived from domain |
226
+ | `{COMPANY_NAME_CAPITALIZED}` | Capitalized variant |
227
+ | `{REAL_COMPANY_NAME}` | Real company name via Hunter.io |
228
+ | `{REAL_COMPANY_LOGO}` / `{REAL_COMPANY_LOGO_URL}` | Company logo |
260
229
 
261
- Design sophisticated email campaigns with dynamic content and advanced personalization:
230
+ **Personalization (Fake Data)**
262
231
 
263
- ```json
264
- {
265
- "subject": "Your Personalized Campaign Subject",
266
- "fromEmail": "campaigns@yourdomain.com",
267
- "priority": "normal",
268
- "fromName": "",
269
- "yourLinks": [],
270
- "linksFromFile": "../links.txt",
271
- "useLinkFromFile": false,
272
- "subjects": {
273
- "enabled": false,
274
- "subjectsPath": "subject.txt",
275
- "offset": 0,
276
- "mode": "sequence",
277
- "countBeforeSubject": 500,
278
- "startFresh": false
279
- },
280
- "fromNames": {
281
- "enabled": false,
282
- "namesPath": "from-names.txt",
283
- "offset": 0,
284
- "mode": "sequence",
285
- "countBeforeName": 500,
286
- "startFresh": false
287
- },
288
- "recipient_file": "recipients.txt",
289
- "body": {
290
- "useHTML": true,
291
- "latterPath": "letter.html",
292
- "image": {
293
- "embedInLetter": false,
294
- "imagePath": "image.png",
295
- "alt": "Campaign Image",
296
- "strictMode": true,
297
- "style": {
298
- "useStyle": false,
299
- "width": "100%",
300
- "height": "100%",
301
- "marginTop": "0px",
302
- "marginBottom": "0px",
303
- "marginLeft": "0px",
304
- "marginRight": "0px",
305
- "paddingTop": "0px",
306
- "paddingBottom": "0px",
307
- "paddingLeft": "0px",
308
- "paddingRight": "0px",
309
- "borderRadius": "0px"
310
- }
311
- }
312
- }
313
- }
314
- ```
232
+ | Tag | Output |
233
+ | --- | ------ |
234
+ | `{FAKE_FIRST_NAME}` / `{FAKE_LAST_NAME}` / `{FAKE_FULL_NAME}` | Random names |
235
+ | `{FAKE_COMPANY_NAME}` / `{FAKE_COMPANY_EMAIL}` | Random company |
236
+ | `{FAKE_EMAIL}` | Random email |
237
+ | `{FAKE_PHONE_NUMBER}` | Random phone |
238
+ | `{FAKE_ADDRESS}` / `{FAKE_CITY}` / `{FAKE_STATE}` / `{FAKE_ZIP_CODE}` / `{FAKE_COUNTRY}` | Random address |
315
239
 
316
- # Calendar Invites (Production)
240
+ **Dates & Time**
317
241
 
318
- Use this guide to attach calendar invites to your emails so recipients can add events directly to their calendars. Supports Microsoft Teams, Google Meet, Zoom, and a generic standard format.
242
+ | Tag | Output |
243
+ | --- | ------ |
244
+ | `{DATE}` / `{TIME}` | Current date/time |
245
+ | `{TODAY_DATE}` / `{TODAY_DATE_SHORT}` / `{TODAY_DATE_LONG}` / `{TODAY_DATE_FULL}` | Date in multiple formats |
246
+ | `{TOMORROW_DATE}` / `{YESTERDAY_DATE}` | Relative dates (also with short/long/full variants) |
319
247
 
320
- ## Scope
321
- - Single-recipient sending with SMTP mode only
322
- - Either attach an existing `.ics` file or generate one dynamically from configuration
323
- - ICS stores times in UTC; email body displays times using the configured timezone
248
+ **Random & Unique**
324
249
 
325
- ## Requirements
326
- - Single-recipient send flow enabled
327
- - Valid meeting links for your chosen platform
328
- - `.ics` file (if using an existing invite)
329
- - Optional `.txt` file for description content
250
+ | Tag | Output |
251
+ | --- | ------ |
252
+ | `{UNIQUE_ID}` / `{UUID}` | Unique identifiers |
253
+ | `{RANDOM_STRING}` / `{RANDOM_50_CHAR_STRING}` / `{RANDOM_100_CHAR_STRING}` | Random strings |
254
+ | `{RANDOM_N_DIGIT_NUMBER}` | Random number with N digits (any length) |
255
+ | `{RANDOM_N_TEXTNUMBER}` | Random alphanumeric string of length N |
330
256
 
331
- ## Configuration
332
- Place a `calendar` block in your message configuration. Tags are supported for dynamic values:
333
- - `@from` uses the sender’s email or name
334
- - `@to` uses the recipient’s email (not valid in batch mode)
335
- - `@email` uses the attendee’s email as display name
257
+ **Encoding**
336
258
 
337
- ```jsonc
338
- {
339
- "calendar": {
340
- "use": true,
341
- "icsPath": "../tmp/meeting.ics",
342
- "useIcsPath": false,
343
- "useMainMessageBody": false,
259
+ | Tag | Output |
260
+ | --- | ------ |
261
+ | `{BASE64_EMAIL_ADDRESS}` / `{BASE64_EMAIL}` | Base64-encoded email |
262
+ | `{BASE64_USERNAME}` / `{BASE64_DOMAIN}` | Base64-encoded parts |
263
+ | `{BASE64_COMPANY_NAME}` / `{BASE64_UUID}` | Base64-encoded values |
344
264
 
345
- // Required
346
- "organizerEmail": "@from",
347
- "attendeeEmail": "@to",
348
- "start": "now",
349
- "end": "+1hours",
265
+ **Special**
350
266
 
351
- // Optional
352
- "type": "teams", // "teams" | "google" | "zoom" | "standard"
353
- "appName": "mister-man", // UID suffix; default "razon" when empty
354
- "title": "Project Kickoff",
355
- "organizerName": "@from",
356
- "attendeeName": "@email",
267
+ | Tag | Output |
268
+ | --- | ------ |
269
+ | `{PAGE_LINK}` | Dynamic page link from config |
270
+ | `{PDF_PASSWORD}` | Auto-generated password (shared across entire email) |
271
+ | `{LOCAL_IMAGE}` | Embedded local image |
357
272
 
358
- // Platform-specific links
359
- "teamsLink": "https://teams.microsoft.com/l/meetup-join/...",
360
- "googleLink": "https://meet.google.com/abc-defg-hij",
361
- "zoomLink": "https://zoom.us/j/1234567890",
362
- "zoomMeetingId": "123 456 7890",
363
- "zoomPasscode": "",
364
-
365
- // Fallback/metadata
366
- "location": "HQ Boardroom", // default "Online" when empty
367
- "importance": "high", // "high" | "normal"
368
- "description": "Agenda:\n- Intro\n- Timeline\n- Next steps",
369
- "descriptionPath": "../tmp/description.txt",
370
- "useDescriptionPath": false,
371
- "timezone": "Africa/Lagos" // pretty HTML timezone; default "UTC" when empty
372
- }
373
- }
374
- ```
273
+ ## Attachments
274
+
275
+ Razon converts HTML templates into multiple attachment formats on the fly, with full tag replacement in every format. Configure in `config/attachments.jsonc`.
276
+
277
+ ### Supported Formats
278
+
279
+ | Format | Description |
280
+ | --------- | ----------- |
281
+ | **PDF** | Generate from HTML. Password protection, landscape/portrait, custom margins, A4/Letter page sizes. |
282
+ | **Image** | Convert HTML to JPEG or PNG. Configurable quality, fit-to-paper modes, background rendering. |
283
+ | **HTML** | Attach raw HTML files with full tag replacement. |
284
+ | **SVG** | Attach SVG vector graphics with tag replacement. |
285
+ | **TXT** | Plain text attachments. |
286
+ | **EML** | Full email-within-email see below. |
287
+
288
+ ### Key Capabilities
289
+
290
+ - **Multiple attachments per email** - Any combination of formats in a single email
291
+ - **Dynamic filenames** - Tags in filenames: `Invoice_{UNIQUE_ID}_{COMPANY_NAME}.pdf`
292
+ - **Tag replacement in content** - All 80+ tags resolve inside attachment HTML before conversion
293
+ - **Password-protected PDFs** - Use `{PDF_PASSWORD}` in your body, and the same password encrypts the PDF
294
+ - **Inline attachments** - Embed PDFs or images directly in the email body
295
+ - **Asset pre-caching** - Pre-generate all attachments with `razon cache-only` for faster campaign sends
296
+
297
+ ### EML Attachments (Email-within-Email)
375
298
 
376
- ## Key Behaviors
377
- - Enable with `use: true` in single-recipient SMTP mode
378
- - Use an existing `.ics` by setting `useIcsPath: true` and `icsPath` to your file; other calendar fields are ignored
379
- - `useMainMessageBody: true` uses your main email body as the calendar description (auto-enabled when `useIcsPath` is true)
380
- - Time inputs for `start` and `end`:
381
- - `"now"`
382
- - Relative time like `"+30minutes"`, `"+2hours"`, `"-3days"`, `"+1week"`, `"+1month"`, `"+1year"`
383
- - `attendeeName`:
384
- - Empty `"Attendee"`
385
- - `@email` attendee email becomes the display name
386
- - `importance`:
387
- - `"high"` highlights priority in some clients
388
- - `"normal"` standard priority
389
- - `location` defaults to `"Online"` if not provided
390
- - `timezone` formats human-readable times in the email body; ICS stays in UTC
391
-
392
- ## Platform Notes
393
- - Microsoft Teams
394
- - Provide a valid Teams link; recipients can use the “Join your Teams meeting” flow from the email
395
- - Google Meet
396
- - Use the `https://meet.google.com/xxx-yyyy-zzz` format
397
- - Guests must be invited or admitted by the host
398
- - Zoom
399
- - Browsers may prompt to open the Zoom app
400
- - Recipients can join via the Zoom Workplace app or the web if prompts don’t appear
401
-
402
- ## Operational Tips
403
- - Prefer dynamic generation when you need consistent formatting and platform-specific buttons in the email body
404
- - Prefer `useIcsPath` when integrating with external scheduling systems that already provide `.ics`
405
- - In non-batch sending, `@to` simplifies attendee assignment
406
- - Keep meeting IDs and passcodes out of logs; treat them as sensitive
299
+ EML is one of Razon's most powerful features. An EML attachment is a fully-formed email (.eml file) attached inside your main email. It has its own sender, subject, body, headers, and can even contain its own attachments.
300
+
301
+ **What makes EML powerful:**
302
+
303
+ - **Own identity** - Each EML has its own `fromEmail`, `fromName`, `subject`, and `priority` — all with tag replacement
304
+ - **Custom headers** - Add any RFC headers (`X-Mailer`, `Reply-To`, etc.) with dynamic tags
305
+ - **CC recipients** - EML attachments can include CC recipients with display names
306
+ - **Nested attachments** - An EML can contain PDF, Image, HTML, SVG, TXT, or even another EML inside it
307
+ - **Full tag flow** - Tags resolve independently in EML content, but `{PDF_PASSWORD}` propagates from the parent email so passwords stay consistent
308
+ - **Separate attachment config** - EML attachments use their own config (`config/eml/attachments.jsonc`), giving you independent control over what goes inside the nested email
309
+
310
+ **Nesting example:**
311
+
312
+ ```
313
+ Main Email
314
+ ├── Body HTML (tags replaced, {PDF_PASSWORD} generated)
315
+ ├── Attachment: Invoice_{UNIQUE_ID}.pdf (password-protected)
316
+ └── Attachment: forwarded-message.eml
317
+ ├── From: {FAKE_FULL_NAME} <{FAKE_EMAIL}>
318
+ ├── Subject: "Re: {COMPANY_NAME} Proposal"
319
+ ├── Headers: X-Original-Sender: {EMAIL_ADDRESS}
320
+ ├── Body HTML (tags replaced, same PDF password)
321
+ └── Nested Attachment: proposal_{UNIQUE_ID}.pdf
407
322
  ```
408
323
 
409
- ### 📎 **Attachment Configuration (`config/attachments.jsonc`)**
324
+ Every layer gets full tag replacement. The PDF password generated in the main body flows through to every nested attachment, so a single `{PDF_PASSWORD}` tag keeps everything in sync.
410
325
 
411
- Configure sophisticated file attachments with dynamic generation and multi-format support:
326
+ ### Pre-caching Assets
412
327
 
413
- ```json
414
- {
415
- "useAttachment": true,
416
- "throwErrorOnInvalidAttachment": true,
417
- "replaceTagsInAttachment": true,
418
- "attachments": [{
419
- "useMe": true,
420
- "format": "PDF",
421
- "attachmentPath": "letterAttachment.html",
422
- "attachmentNameWithPlaceholders": "Document_{UNIQUE_ID}.pdf",
423
- "pdf": {
424
- "usePassword": false,
425
- "password": "secret",
426
- "inlineAttachment": false,
427
- "landscape": false,
428
- "printBackground": true,
429
- "format": "A4",
430
- "margin": {
431
- "top": 1,
432
- "left": 1,
433
- "bottom": 1,
434
- "right": 1
435
- }
436
- },
437
- "image": {
438
- "inlineAttachment": false,
439
- "type": "jpeg",
440
- "format": "A4",
441
- "landscape": true,
442
- "margin": {
443
- "top": 0,
444
- "left": 0,
445
- "bottom": 0,
446
- "right": 0
447
- },
448
- "printBackground": true,
449
- "fitToPaperMode": "Default",
450
- "optimizeForSpeed": true,
451
- "quality": 80
452
- },
453
- "eml": {
454
- "useMessageConfig": true,
455
- "fromEmail": "campaigns@yourdomain.com",
456
- "fromName": "Campaign Team",
457
- "subject": "Attached Email Message",
458
- "priority": "normal",
459
- "attachment": {
460
- "useAttachment": false,
461
- "throwErrorOnInvalidAttachment": false
462
- },
463
- "headers": {
464
- "X-Mailer": "Razon Email Client"
465
- }
466
- }
467
- }]
468
- }
328
+ For large campaigns, pre-generate all attachments before sending:
329
+
330
+ ```bash
331
+ razon cache-only # Generate all assets
332
+ razon cache-only --parallel 8 # Use 8 threads for faster generation
333
+ razon cache-only --template invoice # Cache specific template only
334
+ razon send # Send with pre-cached assets
469
335
  ```
470
336
 
471
- ### 🌐 **OWA Configuration (`config/addon/owa.jsonc`)**
337
+ ## Calendar Invites
472
338
 
473
- Configure Outlook Web Access integration for seamless Office 365 and Exchange Online email sending:
339
+ Attach calendar invites to emails with support for Microsoft Teams, Google Meet, Zoom, and standard ICS format.
474
340
 
475
- ```json
341
+ Add a `calendar` block in `config/message.jsonc`:
342
+
343
+ ```jsonc
476
344
  {
477
- "randomizeEmailServers": true,
478
- "accounts": [{
479
- "useMe": false,
480
- "senderEmail": "your-email@company.com",
481
- "webmail_url": "https://outlook.office.com/mail/",
482
- "cookie_string": "your-session-cookies",
483
- "deleteOnSent": true,
484
- "dailyLimit": 10000,
485
- "retryFailed": false,
486
- "retryCount": 2,
487
- "useProxy": false,
488
- "options": {
489
- "enableHourlyLimit": false,
490
- "sendPerHour": 100,
491
- "enableMinuteLimit": false,
492
- "sendPer10Minutes": 10
493
- }
494
- }]
345
+ "calendar": {
346
+ "use": true,
347
+ "type": "teams", // "teams" | "google" | "zoom" | "standard"
348
+ "title": "Project Kickoff",
349
+ "start": "now",
350
+ "end": "+1hours",
351
+ "organizerEmail": "@from",
352
+ "attendeeEmail": "@to",
353
+ "teamsLink": "https://teams.microsoft.com/l/meetup-join/...",
354
+ "timezone": "America/New_York",
355
+ },
495
356
  }
496
357
  ```
497
358
 
498
- #### **OWA Integration Features:**
499
- - **Native Office 365 Support**: Direct integration with Microsoft Outlook Web Access
500
- - **Session Management**: Automatic cookie handling and session persistence
501
- - **Enterprise Security**: Maintains corporate security policies and compliance
502
- - **Bulk Operations**: Efficient handling of large-scale email campaigns
503
- - **Rate Limiting**: Respects Exchange Online throttling policies
504
- - **Auto-cleanup**: Optional sent item deletion for storage management
505
-
506
- #### **Setting Up OWA Integration:**
507
- 1. **Obtain Session Cookies**: Login to your Outlook Web Access and extract session cookies
508
- 2. **Configure Account**: Add your corporate email and webmail URL
509
- 3. **Set Limits**: Configure daily and hourly sending limits per your organization's policies
510
- 4. **Test Connection**: Verify connectivity before launching campaigns
511
-
512
- ## Template System
513
-
514
- ### HTML Templates
515
-
516
- Create rich HTML email templates with dynamic content:
517
-
518
- ```html
519
- <!DOCTYPE html>
520
- <html>
521
- <head>
522
- <meta charset="UTF-8">
523
- <title>{SUBJECT}</title>
524
- <style>
525
- body { font-family: Arial, sans-serif; }
526
- .header { background-color: #f0f0f0; padding: 20px; }
527
- .content { padding: 20px; }
528
- .footer { background-color: #333; color: white; padding: 10px; }
529
- </style>
530
- </head>
531
- <body>
532
- <div class="header">
533
- <h1>Welcome {FAKE_FIRST_NAME}!</h1>
534
- </div>
535
-
536
- <div class="content">
537
- <p>Dear {FAKE_FIRST_NAME} {FAKE_LAST_NAME},</p>
538
-
539
- <p>Thank you for your interest in our services. This email was sent on {DATE} at {TIME}.</p>
540
-
541
- <p>Your unique reference ID is: <strong>{UNIQUE_ID}</strong></p>
542
-
543
- <p>Company: {FAKE_COMPANY_NAME}</p>
544
- <p>Phone: {FAKE_PHONE_NUMBER}</p>
545
- <p>Address: {FAKE_ADDRESS}</p>
546
-
547
- <a href="{PAGE_LINK}" style="background-color: #007cba; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px;">
548
- Visit Our Website
549
- </a>
550
- </div>
551
-
552
- <div class="footer">
553
- <p>© 2024 Your Company. All rights reserved.</p>
554
- <p>Random Number: {RANDOM_NUMBER_5}</p>
555
- </div>
556
- </body>
557
- </html>
558
- ```
559
-
560
- ## Tag System
561
-
562
- The application includes a powerful tag replacement system with 50+ built-in tags for dynamic content generation.
563
-
564
- ### Basic Tags
565
-
566
- | Tag | Description | Example Output |
567
- |-----|-------------|----------------|
568
- | `{EMAIL_ADDRESS}` | Recipient's email address | `john.doe@example.com` |
569
- | `{UNIQUE_ID}` | Unique identifier | `abc123def456` |
570
- | `{DATE}` | Current date | `2024-01-15` |
571
- | `{TIME}` | Current time | `14:30:25` |
572
- | `{TOMORROW_DATE}` | Tomorrow's date | `2024-01-16` |
573
- | `{YESTERDAY_DATE}` | Yesterday's date | `2024-01-14` |
574
-
575
- ### Fake Data Tags
576
-
577
- | Tag | Description | Example Output |
578
- |-----|-------------|----------------|
579
- | `{FAKE_FIRST_NAME}` | Random first name | `John` |
580
- | `{FAKE_LAST_NAME}` | Random last name | `Smith` |
581
- | `{FAKE_FULL_NAME}` | Random full name | `John Smith` |
582
- | `{FAKE_COMPANY_NAME}` | Random company name | `Tech Solutions Inc` |
583
- | `{FAKE_EMAIL}` | Random email address | `john.smith@example.com` |
584
- | `{FAKE_PHONE_NUMBER}` | Random phone number | `+1-555-123-4567` |
585
- | `{FAKE_ADDRESS}` | Random street address | `123 Main Street` |
586
- | `{FAKE_CITY}` | Random city name | `New York` |
587
- | `{FAKE_STATE}` | Random state name | `California` |
588
- | `{FAKE_ZIP_CODE}` | Random ZIP code | `90210` |
589
- | `{FAKE_COUNTRY}` | Random country name | `United States` |
590
-
591
- ### Random Number Tags
592
-
593
- | Tag | Description | Example Output |
594
- |-----|-------------|----------------|
595
- | `{RANDOM_NUMBER_3}` | 3-digit random number | `847` |
596
- | `{RANDOM_NUMBER_5}` | 5-digit random number | `92847` |
597
- | `{RANDOM_NUMBER_8}` | 8-digit random number | `38472951` |
598
-
599
- ### Special Tags
600
-
601
- | Tag | Description | Example Output |
602
- |-----|-------------|----------------|
603
- | `{PAGE_LINK}` | Dynamic page link | `https://example.com` |
604
- | `{REAL_COMPANY_NAME}` | Real company from domain | `Google Inc` |
605
-
606
- ## Best Practices
607
-
608
- ### 1. SMTP Security
609
- - Use environment variables for sensitive credentials
610
- - Enable two-factor authentication where possible
611
- - Regularly rotate passwords and API keys
612
-
613
- ### 2. Rate Limiting
614
- - Monitor your SMTP provider's rate limits
615
- - Configure appropriate delays between emails
616
- - Use multiple SMTP accounts for load balancing
617
-
618
- ### 3. Content Management
619
- - Test email templates in multiple clients
620
- - Use inline CSS for better compatibility
621
- - Optimize images to keep email size manageable
622
-
623
- ### 4. Attachment Management
624
- - Limit attachment size and number
625
- - Use cloud storage links for large files
626
- - Encrypt sensitive attachments when necessary
627
-
628
- ### 5. Logging and Monitoring
629
- - Enable comprehensive logging for troubleshooting
630
- - Monitor logs for delivery failures
631
- - Implement log rotation to manage disk usage
359
+ Time formats: `"now"`, `"+30minutes"`, `"+2hours"`, `"+1week"`, `"+1month"`
632
360
 
633
361
  ## License
634
362
 
635
- MIT License - Feel free to use this project in your own applications, both personal and commercial.
363
+ Proprietary. A license is required to use this software. Visit [Trovyx](https://trovyx.pro) to obtain a license.
636
364
 
637
365
  ---
638
366
 
639
- **Made with ❤️ by Razon Team**
367
+ **Razon** by [Trovyx](https://trovyx.pro)