nolimit-x 1.0.87 → 1.0.89

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolimit-x",
3
- "version": "1.0.87",
3
+ "version": "1.0.89",
4
4
  "description": "Advanced email sender ",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -289,11 +289,10 @@ class AdvancedNameExtractor {
289
289
 
290
290
  // Advanced: Try all possible splits and score them
291
291
  advancedBestSplitName(localPart) {
292
- // Remove trailing numbers for splitting
293
- const match = localPart.match(/^(.*?)(\d*)$/);
294
- const base = match ? match[1] : localPart;
295
- // const trailing = match ? match[2] : '';
296
- const lower = base.toLowerCase();
292
+ // Remove ALL digits for splitting (not just trailing)
293
+ const base = localPart.replace(/\d+/g, '').toLowerCase();
294
+ if (base.length < 4) return null; // too short after stripping digits
295
+ const lower = base;
297
296
  let best = null;
298
297
  let bestScore = -Infinity;
299
298
  // Two-part splits
@@ -711,9 +710,8 @@ class AdvancedNameExtractor {
711
710
  source: 'local-split-fallback',
712
711
  };
713
712
  }
714
- // 3. Only fallback to 'Valued Customer' if both above fail
715
713
  return {
716
- name: 'Valued Customer',
714
+ name: 'User',
717
715
  confidence: 30,
718
716
  source: 'fallback',
719
717
  };
package/src/processor.js CHANGED
@@ -399,13 +399,30 @@ class CampaignProcessor {
399
399
 
400
400
  // Use provided name from CSV leads, or fall back to extractor
401
401
  let nameResult;
402
+ let firstName, fullName;
402
403
  if (providedName) {
403
404
  nameResult = { name: providedName, confidence: 100, method: 'user-provided' };
405
+ // User explicitly provided this name — respect it as-is for NAME
406
+ const parts = providedName.trim().split(/\s+/);
407
+ firstName = parts[0];
408
+ fullName = providedName;
404
409
  } else {
405
410
  nameResult = await this.nameExtractor.extractAdvancedName(email, {
406
411
  confidenceThreshold: 50,
407
412
  maxMethods: 4
408
413
  });
414
+ // If extractor returned a real name (not fallback), use first name only
415
+ // Corporate style: "Hi Mark" not "Hi Mark Bruce"
416
+ if (nameResult.source !== 'fallback') {
417
+ const parts = (nameResult.name || '').trim().split(/\s+/);
418
+ firstName = parts[0];
419
+ fullName = nameResult.name;
420
+ nameResult.name = firstName;
421
+ } else {
422
+ // Fallback ("Valued Customer") — keep as-is
423
+ firstName = nameResult.name;
424
+ fullName = nameResult.name;
425
+ }
409
426
  }
410
427
 
411
428
 
@@ -517,6 +534,8 @@ class CampaignProcessor {
517
534
  let context = {
518
535
  EMAIL: email,
519
536
  NAME: nameResult.name,
537
+ FIRST_NAME: firstName,
538
+ FULL_NAME: fullName,
520
539
  COMPANY: companyResult.name,
521
540
  LINK: processedLink,
522
541
  FROM_EMAIL: senderEmail,