@trovyx/razon 0.0.1 → 0.0.3

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 (4) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +291 -559
  3. package/bin/index.js +1 -1
  4. package/package.json +30 -2
package/README.md CHANGED
@@ -1,639 +1,371 @@
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
+ ## Documentation
31
+
32
+ Run `razon init` to generate configuration files and the complete user guide (`README.txt`). It covers every configuration option, all sending modes, attachment formats, template tags, calendar invites, DKIM setup, and more.
33
+
34
+ ## Features
35
+
36
+ - **Multi-Provider SMTP** - Unlimited SMTP accounts with automatic failover and load balancing
37
+ - **Outlook Web Access (OWA)** - Native Office 365 and Exchange Online support
38
+ - **Dynamic Templates** - 50+ built-in tags for personalized HTML emails
39
+ - **Attachments** - PDF, HTML, images (PNG/JPG), SVG, and EML with dynamic generation
40
+ - **Password-Protected PDFs** - Generate encrypted PDF attachments on the fly
41
+ - **Calendar Invites** - Attach .ics invites for Teams, Google Meet, Zoom, or custom events
42
+ - **DKIM Signing** - Generate DKIM keys for improved inbox delivery
43
+ - **Bulk & Batch Sending** - BCC, CC, and TO distribution modes with configurable batch sizes
44
+ - **Smart Rate Limiting** - Hourly, daily, and per-minute throttling per provider
45
+ - **Proxy Support** - SOCKS5 and HTTP proxies for geographic distribution
46
+ - **Parallel Connections** - Concurrent email processing for maximum throughput
47
+ - **Contact Enrichment** - Company name and logo lookup via Hunter.io
48
+ - **Asset Caching** - Pre-generate PDFs, SVGs, and images before sending
49
+ - **Custom Tags** - Define per-recipient variables from CSV/Excel columns
50
+ - **Database Tracking** - Track sent emails, prevent duplicates, backup and restore
51
+ - **Device Auth** - Multi-device authentication with PIN and security questions
52
+
53
+ ## Commands
54
+
55
+ ### Sending
56
+
59
57
  ```bash
60
- # Install required dependencies
61
- npm install
58
+ razon send # Send to all recipients
59
+ razon send 100 # Send to first 100 recipients
60
+ razon send -f # Force re-send to already-sent recipients
61
+ razon send --throttle --delay 10 # Throttle with 10s delay between batches
62
+ razon send --email-before-sleep 500 # Send 500 emails per batch
63
+ razon send --randomize-servers # Randomize SMTP server selection
64
+ razon send --test-between # Insert test emails during campaign
65
+ razon send --email-before-test 200 # Send test email every 200 emails
62
66
  ```
63
67
 
64
- 3. **Initialize configuration**:
68
+ ### Testing
69
+
65
70
  ```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
71
+ razon test # Send test emails (default: 5)
72
+ razon test 10 # Send 10 test emails
70
73
  ```
71
74
 
72
- 4. **Build the project**:
75
+ ### Asset Caching
76
+
73
77
  ```bash
74
- # Build the application
75
- npm run build
78
+ razon cache-only # Cache email assets without sending
79
+ razon cache-only -f # Force regenerate cached assets
80
+ razon cache-only --template my-template # Cache specific template assets
81
+ razon cache-only --parallel 8 # Use 8 parallel threads
82
+ razon cache-only --clean # Remove existing assets before caching
83
+ razon cache-only --clear-only # Remove all cached assets
84
+ razon cache-only --clear-only my-template # Remove cache for specific template
76
85
  ```
77
86
 
78
- ### Docker Installation (Alternative)
87
+ ### Contact Enrichment
79
88
 
80
89
  ```bash
81
- # Pull the official Razon image
82
- docker pull razon/email-client:latest
90
+ razon cache leads.txt # Cache company names & logos
91
+ razon cache leads.csv -a ./api.txt # Specify Hunter.io API key file
92
+ razon cache leads.csv -s # Skip names, logos only
93
+ razon cache leads.csv -b 20 # Process 20 domains per batch
94
+
95
+ razon contacts leads.txt # Enrich file with company data
96
+ razon contacts data.csv -e 3 -c 5 # Email in col 3, company name to col 5
97
+ razon contacts leads.xlsx -m file # Download logo images to files
98
+ razon contacts data.csv --skip-logo # Company names only
99
+ razon contacts leads.csv -o xlsx # Force Excel output
100
+ ```
101
+
102
+ ### Email List Management
83
103
 
84
- # Run with volume mounting for configuration
85
- docker run -v $(pwd)/config:/app/config razon/email-client:latest
104
+ ```bash
105
+ razon remove-dup emails.txt # Remove duplicate emails
106
+ razon remove-bad emails.txt # Remove invalid emails
107
+ razon remove-bad emails.csv -t provider -d gmail.com,yahoo.com # Remove by provider
108
+ razon remove-non-unique new.txt # Remove emails already in database
109
+ razon remove-unique all.txt # Keep only emails in database
86
110
  ```
87
111
 
88
- ## Quick Start
112
+ ### Tags
89
113
 
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:
114
+ ```bash
115
+ razon tags # Show available template tags
116
+ razon tags contacts.csv # Show tags from CSV/Excel columns
117
+ ```
118
+
119
+ ### DKIM
126
120
 
127
121
  ```bash
128
- # Enable test mode in config/core.jsonc
129
- {
130
- "enableTestMode": true,
131
- "testLeadsFile": "test-recipients.txt",
132
- "testLeadsLimit": 5
133
- }
122
+ razon dkim yourdomain.com # Generate DKIM keys
123
+ razon dkim yourdomain.com -s myselector # Custom selector name
124
+ razon dkim yourdomain.com -o ./keys # Custom output directory
125
+ razon dkim # Show full DKIM help
126
+ ```
134
127
 
135
- # Create test recipients
136
- echo "test@yourdomain.com" > test-recipients.txt
128
+ ### Database & Backups
137
129
 
138
- # Run test campaign
139
- npm run test
130
+ ```bash
131
+ razon count-total # Show emails sent per provider
132
+ razon summary # Full system summary
133
+ razon summary --smtp # SMTP summary only
134
+ razon summary --owa # OWA summary only
135
+
136
+ razon backup # Create database backup
137
+ razon backup my-backup # Named backup
138
+ razon list-backups # List available backups
139
+ razon restore my-backup # Restore from backup
140
+ razon restore my-backup -c # Clear database before restore
141
+ razon clear --confirm # Clear entire database (irreversible)
140
142
  ```
141
143
 
142
- ### 📊 **Monitor Your Campaign**
144
+ ### Authentication
143
145
 
144
146
  ```bash
145
- # View real-time logs
146
- tail -f mailer.log
147
+ razon login <token> # Authenticate with access token
148
+ razon logout # Log out current device
149
+
150
+ razon auth list # List registered devices
151
+ razon auth device <id> # Show device details
152
+ razon auth pin # Change your PIN
153
+ razon auth reset-pin <token> # Reset PIN via security questions
154
+ razon auth add-security # Add a security question
155
+ ```
147
156
 
148
- # Check delivery status
149
- npm run status
157
+ ### System
150
158
 
151
- # View campaign analytics
152
- npm run analytics
159
+ ```bash
160
+ razon init # Create config files
161
+ razon init -f # Force overwrite existing config
162
+ razon install # Install Chromium for PDF/image generation
163
+ razon install-pdf # Install PDF conversion binary
164
+ razon check-update # Check for available updates
165
+ razon upgrade # Upgrade Razon to latest version
166
+ razon upgrade -f # Force reinstall
167
+ razon version # Show version
153
168
  ```
154
169
 
155
170
  ## Configuration
156
171
 
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.
172
+ Run `razon init` to generate all config files in a `config/` folder:
173
+
174
+ | File | Purpose |
175
+ | ----------------------- | ---------------------------------------------------------------- |
176
+ | `core.jsonc` | Global settings, test mode, proxy, parallel connections, logging |
177
+ | `smtp.jsonc` | SMTP provider accounts and rate limits |
178
+ | `message.jsonc` | Email subject, body, recipients, calendar invites |
179
+ | `attachments.jsonc` | PDF, image, HTML, SVG, and EML attachment settings |
180
+ | `addon/owa.jsonc` | Outlook Web Access accounts |
181
+ | `eml/attachments.jsonc` | EML-specific attachment settings |
182
+
183
+ All config files use JSONC format (JSON with comments).
184
+
185
+ ## Template Tags
158
186
 
159
- ### 📁 **Configuration Structure**
187
+ 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.
188
+
189
+ ### How Tags Flow
190
+
191
+ 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.
192
+
193
+ Tags flow through every layer of your email:
160
194
 
161
195
  ```
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
196
+ Subject → "Hello {FIRST_NAME}, your invoice {UNIQUE_ID}"
197
+ From Name → "{FAKE_FULL_NAME}"
198
+ Body HTML → All tags replaced, including {PDF_PASSWORD}
199
+ Attachment HTML → Tags replaced before converting to PDF/Image
200
+ Attachment Name → "Invoice_{UNIQUE_ID}.pdf"
201
+ EML Subject → Tags replaced independently
202
+ EML Headers → Custom headers with tags
203
+ EML Body → Full tag replacement inside nested email
204
+ Calendar Invite → Tags in title, description, attendee fields
171
205
  ```
172
206
 
173
- ### ⚙️ **Core Configuration (`config/core.jsonc`)**
207
+ 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
208
 
175
- The central configuration file that controls Razon's core functionality and global behavior:
209
+ ### Custom Tags from CSV/Excel (Highest Priority)
176
210
 
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
- }
211
+ 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.
212
+
213
+ ```
214
+ CSV: Email, First Name, Company, Deal Size
215
+ → {FIRST_NAME}, {COMPANY}, {DEAL_SIZE}
219
216
  ```
220
217
 
221
- ### 📧 **SMTP Configuration (`config/smtp.jsonc`)**
218
+ Use `razon tags` to inspect available tags for your recipient file.
222
219
 
223
- Configure multiple email providers with intelligent load balancing and failover capabilities:
220
+ ### Built-in Tags
224
221
 
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
- ```
222
+ **Recipient & Domain**
258
223
 
259
- ### 📝 **Message Configuration (`config/message.jsonc`)**
224
+ | Tag | Output |
225
+ | --- | ------ |
226
+ | `{EMAIL_ADDRESS}` / `{EMAIL}` | Recipient's email |
227
+ | `{USERNAME}` | Local part of email |
228
+ | `{DOMAIN}` | Domain of email |
229
+ | `{COMPANY_NAME}` | Company name derived from domain |
230
+ | `{COMPANY_NAME_CAPITALIZED}` | Capitalized variant |
231
+ | `{REAL_COMPANY_NAME}` | Real company name via Hunter.io |
232
+ | `{REAL_COMPANY_LOGO}` / `{REAL_COMPANY_LOGO_URL}` | Company logo |
260
233
 
261
- Design sophisticated email campaigns with dynamic content and advanced personalization:
234
+ **Personalization (Fake Data)**
262
235
 
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
- ```
236
+ | Tag | Output |
237
+ | --- | ------ |
238
+ | `{FAKE_FIRST_NAME}` / `{FAKE_LAST_NAME}` / `{FAKE_FULL_NAME}` | Random names |
239
+ | `{FAKE_COMPANY_NAME}` / `{FAKE_COMPANY_EMAIL}` | Random company |
240
+ | `{FAKE_EMAIL}` | Random email |
241
+ | `{FAKE_PHONE_NUMBER}` | Random phone |
242
+ | `{FAKE_ADDRESS}` / `{FAKE_CITY}` / `{FAKE_STATE}` / `{FAKE_ZIP_CODE}` / `{FAKE_COUNTRY}` | Random address |
315
243
 
316
- # Calendar Invites (Production)
244
+ **Dates & Time**
317
245
 
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.
246
+ | Tag | Output |
247
+ | --- | ------ |
248
+ | `{DATE}` / `{TIME}` | Current date/time |
249
+ | `{TODAY_DATE}` / `{TODAY_DATE_SHORT}` / `{TODAY_DATE_LONG}` / `{TODAY_DATE_FULL}` | Date in multiple formats |
250
+ | `{TOMORROW_DATE}` / `{YESTERDAY_DATE}` | Relative dates (also with short/long/full variants) |
319
251
 
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
252
+ **Random & Unique**
324
253
 
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
254
+ | Tag | Output |
255
+ | --- | ------ |
256
+ | `{UNIQUE_ID}` / `{UUID}` | Unique identifiers |
257
+ | `{RANDOM_STRING}` / `{RANDOM_50_CHAR_STRING}` / `{RANDOM_100_CHAR_STRING}` | Random strings |
258
+ | `{RANDOM_N_DIGIT_NUMBER}` | Random number with N digits (any length) |
259
+ | `{RANDOM_N_TEXTNUMBER}` | Random alphanumeric string of length N |
330
260
 
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
261
+ **Encoding**
336
262
 
337
- ```jsonc
338
- {
339
- "calendar": {
340
- "use": true,
341
- "icsPath": "../tmp/meeting.ics",
342
- "useIcsPath": false,
343
- "useMainMessageBody": false,
263
+ | Tag | Output |
264
+ | --- | ------ |
265
+ | `{BASE64_EMAIL_ADDRESS}` / `{BASE64_EMAIL}` | Base64-encoded email |
266
+ | `{BASE64_USERNAME}` / `{BASE64_DOMAIN}` | Base64-encoded parts |
267
+ | `{BASE64_COMPANY_NAME}` / `{BASE64_UUID}` | Base64-encoded values |
344
268
 
345
- // Required
346
- "organizerEmail": "@from",
347
- "attendeeEmail": "@to",
348
- "start": "now",
349
- "end": "+1hours",
269
+ **Special**
350
270
 
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",
271
+ | Tag | Output |
272
+ | --- | ------ |
273
+ | `{PAGE_LINK}` | Dynamic page link from config |
274
+ | `{PDF_PASSWORD}` | Auto-generated password (shared across entire email) |
275
+ | `{LOCAL_IMAGE}` | Embedded local image |
357
276
 
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
- ```
277
+ ## Attachments
278
+
279
+ Razon converts HTML templates into multiple attachment formats on the fly, with full tag replacement in every format. Configure in `config/attachments.jsonc`.
280
+
281
+ ### Supported Formats
282
+
283
+ | Format | Description |
284
+ | --------- | ----------- |
285
+ | **PDF** | Generate from HTML. Password protection, landscape/portrait, custom margins, A4/Letter page sizes. |
286
+ | **Image** | Convert HTML to JPEG or PNG. Configurable quality, fit-to-paper modes, background rendering. |
287
+ | **HTML** | Attach raw HTML files with full tag replacement. |
288
+ | **SVG** | Attach SVG vector graphics with tag replacement. |
289
+ | **TXT** | Plain text attachments. |
290
+ | **EML** | Full email-within-email see below. |
291
+
292
+ ### Key Capabilities
293
+
294
+ - **Multiple attachments per email** - Any combination of formats in a single email
295
+ - **Dynamic filenames** - Tags in filenames: `Invoice_{UNIQUE_ID}_{COMPANY_NAME}.pdf`
296
+ - **Tag replacement in content** - All 80+ tags resolve inside attachment HTML before conversion
297
+ - **Password-protected PDFs** - Use `{PDF_PASSWORD}` in your body, and the same password encrypts the PDF
298
+ - **Inline attachments** - Embed PDFs or images directly in the email body
299
+ - **Asset pre-caching** - Pre-generate all attachments with `razon cache-only` for faster campaign sends
300
+
301
+ ### EML Attachments (Email-within-Email)
375
302
 
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
303
+ 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.
304
+
305
+ **What makes EML powerful:**
306
+
307
+ - **Own identity** - Each EML has its own `fromEmail`, `fromName`, `subject`, and `priority` — all with tag replacement
308
+ - **Custom headers** - Add any RFC headers (`X-Mailer`, `Reply-To`, etc.) with dynamic tags
309
+ - **CC recipients** - EML attachments can include CC recipients with display names
310
+ - **Nested attachments** - An EML can contain PDF, Image, HTML, SVG, TXT, or even another EML inside it
311
+ - **Full tag flow** - Tags resolve independently in EML content, but `{PDF_PASSWORD}` propagates from the parent email so passwords stay consistent
312
+ - **Separate attachment config** - EML attachments use their own config (`config/eml/attachments.jsonc`), giving you independent control over what goes inside the nested email
313
+
314
+ **Nesting example:**
315
+
316
+ ```
317
+ Main Email
318
+ ├── Body HTML (tags replaced, {PDF_PASSWORD} generated)
319
+ ├── Attachment: Invoice_{UNIQUE_ID}.pdf (password-protected)
320
+ └── Attachment: forwarded-message.eml
321
+ ├── From: {FAKE_FULL_NAME} <{FAKE_EMAIL}>
322
+ ├── Subject: "Re: {COMPANY_NAME} Proposal"
323
+ ├── Headers: X-Original-Sender: {EMAIL_ADDRESS}
324
+ ├── Body HTML (tags replaced, same PDF password)
325
+ └── Nested Attachment: proposal_{UNIQUE_ID}.pdf
407
326
  ```
408
327
 
409
- ### 📎 **Attachment Configuration (`config/attachments.jsonc`)**
328
+ 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
329
 
411
- Configure sophisticated file attachments with dynamic generation and multi-format support:
330
+ ### Pre-caching Assets
412
331
 
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
- }
332
+ For large campaigns, pre-generate all attachments before sending:
333
+
334
+ ```bash
335
+ razon cache-only # Generate all assets
336
+ razon cache-only --parallel 8 # Use 8 threads for faster generation
337
+ razon cache-only --template invoice # Cache specific template only
338
+ razon send # Send with pre-cached assets
469
339
  ```
470
340
 
471
- ### 🌐 **OWA Configuration (`config/addon/owa.jsonc`)**
341
+ ## Calendar Invites
472
342
 
473
- Configure Outlook Web Access integration for seamless Office 365 and Exchange Online email sending:
343
+ Attach calendar invites to emails with support for Microsoft Teams, Google Meet, Zoom, and standard ICS format.
474
344
 
475
- ```json
345
+ Add a `calendar` block in `config/message.jsonc`:
346
+
347
+ ```jsonc
476
348
  {
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
- }]
349
+ "calendar": {
350
+ "use": true,
351
+ "type": "teams", // "teams" | "google" | "zoom" | "standard"
352
+ "title": "Project Kickoff",
353
+ "start": "now",
354
+ "end": "+1hours",
355
+ "organizerEmail": "@from",
356
+ "attendeeEmail": "@to",
357
+ "teamsLink": "https://teams.microsoft.com/l/meetup-join/...",
358
+ "timezone": "America/New_York",
359
+ },
495
360
  }
496
361
  ```
497
362
 
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
363
+ Time formats: `"now"`, `"+30minutes"`, `"+2hours"`, `"+1week"`, `"+1month"`
632
364
 
633
365
  ## License
634
366
 
635
- MIT License - Feel free to use this project in your own applications, both personal and commercial.
367
+ Proprietary. A license is required to use this software. Visit [Trovyx](https://trovyx.pro) to obtain a license.
636
368
 
637
369
  ---
638
370
 
639
- **Made with ❤️ by Razon Team**
371
+ **Razon** by [Trovyx](https://trovyx.pro)