@bernierllc/sender-identity-verification 3.0.10 → 3.0.11

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.
@@ -0,0 +1,34 @@
1
+ import { IEmailDomainVerification } from './types.js';
2
+ import type { EmailSenderManager, SenderProviderPlugin } from '@bernierllc/email-sender-manager';
3
+ /**
4
+ * Configuration for sender identity verification service
5
+ */
6
+ export interface SenderIdentityConfig {
7
+ emailSenderConfig: {
8
+ provider?: string;
9
+ apiKey?: string;
10
+ };
11
+ domainVerificationConfig: {
12
+ instance?: IEmailDomainVerification;
13
+ };
14
+ senderManager?: EmailSenderManager;
15
+ providerPlugins?: SenderProviderPlugin[];
16
+ retryConfig?: {
17
+ maxRetries?: number;
18
+ initialDelayMs?: number;
19
+ maxDelayMs?: number;
20
+ };
21
+ verificationBaseUrl: string;
22
+ verificationFromEmail: string;
23
+ verificationFromName: string;
24
+ sendgridApiKey?: string;
25
+ mailgunApiKey?: string;
26
+ sesAccessKey?: string;
27
+ sesSecretKey?: string;
28
+ sesRegion?: string;
29
+ databaseUrl?: string;
30
+ }
31
+ /**
32
+ * Load configuration from environment variables
33
+ */
34
+ export declare function loadConfigFromEnv(overrides?: Partial<SenderIdentityConfig>): SenderIdentityConfig;
package/dist/config.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.loadConfigFromEnv = loadConfigFromEnv;
11
+ /**
12
+ * Load configuration from environment variables
13
+ */
14
+ function loadConfigFromEnv(overrides = {}) {
15
+ const config = {
16
+ verificationBaseUrl: process.env.SENDER_VERIFICATION_BASE_URL || overrides.verificationBaseUrl || '',
17
+ verificationFromEmail: process.env.SENDER_VERIFICATION_FROM_EMAIL || overrides.verificationFromEmail || 'noreply@example.com',
18
+ verificationFromName: process.env.SENDER_VERIFICATION_FROM_NAME || overrides.verificationFromName || 'Email Verification',
19
+ sendgridApiKey: process.env.SENDGRID_API_KEY || overrides.sendgridApiKey,
20
+ mailgunApiKey: process.env.MAILGUN_API_KEY || overrides.mailgunApiKey,
21
+ sesAccessKey: process.env.AWS_SES_ACCESS_KEY || overrides.sesAccessKey,
22
+ sesSecretKey: process.env.AWS_SES_SECRET_KEY || overrides.sesSecretKey,
23
+ sesRegion: process.env.AWS_SES_REGION || overrides.sesRegion || 'us-east-1',
24
+ databaseUrl: process.env.DATABASE_URL || overrides.databaseUrl,
25
+ emailSenderConfig: overrides.emailSenderConfig || {},
26
+ domainVerificationConfig: overrides.domainVerificationConfig || {},
27
+ senderManager: overrides.senderManager,
28
+ providerPlugins: overrides.providerPlugins,
29
+ retryConfig: overrides.retryConfig
30
+ };
31
+ // Log configuration (without sensitive data)
32
+ console.log('⚙️ Sender Identity Verification Configuration:');
33
+ console.log(` └── Verification Base URL: ${config.verificationBaseUrl || '(not set)'}`);
34
+ console.log(` └── From Email: ${config.verificationFromEmail}`);
35
+ console.log(` └── SendGrid: ${config.sendgridApiKey ? '***configured***' : '(not set)'}`);
36
+ console.log(` └── Mailgun: ${config.mailgunApiKey ? '***configured***' : '(not set)'}`);
37
+ console.log(` └── SES: ${config.sesAccessKey ? '***configured***' : '(not set)'}`);
38
+ console.log(` └── Database: ${config.databaseUrl ? '***configured***' : '(not set)'}`);
39
+ return config;
40
+ }
@@ -0,0 +1,39 @@
1
+ import { SenderIdentityResult } from './types.js';
2
+ /**
3
+ * Typed error code union for sender-identity-verification errors.
4
+ *
5
+ * Replaces the previous `SenderErrorCode` enum (removed in 2.0.0).
6
+ * Consumers should use the string literal directly, e.g. `'SENDER_NOT_FOUND'`.
7
+ */
8
+ export type SenderVerificationErrorCode = 'SENDER_VERIFICATION_ERROR' | 'SENDER_NOT_FOUND' | 'SENDER_ALREADY_EXISTS' | 'SENDER_LOCKED' | 'VERIFICATION_EXPIRED' | 'VERIFICATION_FAILED' | 'DOMAIN_NOT_VERIFIED' | 'PROVIDER_ERROR' | 'INVALID_EMAIL' | 'RATE_LIMIT_EXCEEDED';
9
+ /**
10
+ * Options bag accepted by `SenderVerificationError`.
11
+ *
12
+ * - `cause`: chained underlying error (ES2022 Error.cause).
13
+ * - `code`: a typed error code from {@link SenderVerificationErrorCode}.
14
+ * - `context`: arbitrary structured context — senderId/details/etc.
15
+ * The legacy `details` ctor argument is now stored under `context.details`.
16
+ */
17
+ export interface SenderVerificationErrorOptions {
18
+ cause?: Error;
19
+ code?: SenderVerificationErrorCode;
20
+ context?: Record<string, unknown>;
21
+ }
22
+ /**
23
+ * Custom error class for sender verification errors.
24
+ *
25
+ * Uses native ES2022 `Error.cause` for error chaining — read the underlying
26
+ * error via `error.cause`. Structured fields (senderId, details, etc.) live
27
+ * on `error.context` since 2.0.0.
28
+ */
29
+ export declare class SenderVerificationError extends Error {
30
+ readonly code: SenderVerificationErrorCode;
31
+ readonly context?: Record<string, unknown>;
32
+ constructor(message: string, options?: SenderVerificationErrorOptions);
33
+ }
34
+ /**
35
+ * Error handling wrapper — converts arbitrary errors to a
36
+ * `SenderIdentityResult<never>` envelope. Reads `error.code` (now a string
37
+ * literal under the new union) to populate `errors`.
38
+ */
39
+ export declare function handleSenderError(error: unknown): SenderIdentityResult<never>;
package/dist/errors.js ADDED
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SenderVerificationError = void 0;
11
+ exports.handleSenderError = handleSenderError;
12
+ /**
13
+ * Custom error class for sender verification errors.
14
+ *
15
+ * Uses native ES2022 `Error.cause` for error chaining — read the underlying
16
+ * error via `error.cause`. Structured fields (senderId, details, etc.) live
17
+ * on `error.context` since 2.0.0.
18
+ */
19
+ class SenderVerificationError extends Error {
20
+ code;
21
+ context;
22
+ constructor(message, options) {
23
+ super(message, options?.cause ? { cause: options.cause } : undefined);
24
+ this.name = 'SenderVerificationError';
25
+ this.code = options?.code ?? 'SENDER_VERIFICATION_ERROR';
26
+ if (options?.context !== undefined) {
27
+ this.context = options.context;
28
+ }
29
+ Error.captureStackTrace?.(this, this.constructor);
30
+ }
31
+ }
32
+ exports.SenderVerificationError = SenderVerificationError;
33
+ /**
34
+ * Error handling wrapper — converts arbitrary errors to a
35
+ * `SenderIdentityResult<never>` envelope. Reads `error.code` (now a string
36
+ * literal under the new union) to populate `errors`.
37
+ */
38
+ function handleSenderError(error) {
39
+ if (error instanceof SenderVerificationError) {
40
+ return {
41
+ success: false,
42
+ error: error.message,
43
+ errors: [error.code]
44
+ };
45
+ }
46
+ if (error instanceof Error) {
47
+ return {
48
+ success: false,
49
+ error: error.message
50
+ };
51
+ }
52
+ return {
53
+ success: false,
54
+ error: 'Unknown error occurred'
55
+ };
56
+ }
@@ -0,0 +1,7 @@
1
+ export { SenderIdentityVerification } from './SenderIdentityVerification.js';
2
+ export { SenderIdentityConfig, loadConfigFromEnv } from './config.js';
3
+ export { SenderVerificationError, handleSenderError } from './errors.js';
4
+ export type { SenderVerificationErrorCode, SenderVerificationErrorOptions } from './errors.js';
5
+ export { SenderIdentity, SenderStatus, EmailProvider, CreateSenderInput, UpdateSenderInput, VerificationResult, ComplianceCheckResult, ListSendersOptions, SenderIdentityResult, DomainVerificationStatus, IEmailDomainVerification } from './types.js';
6
+ export { getManualInstructions, isManualVerificationProvider } from './manual-instructions.js';
7
+ export type { ManualVerificationInstruction } from './manual-instructions.js';
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.isManualVerificationProvider = exports.getManualInstructions = exports.EmailProvider = exports.SenderStatus = exports.handleSenderError = exports.SenderVerificationError = exports.loadConfigFromEnv = exports.SenderIdentityVerification = void 0;
11
+ var SenderIdentityVerification_js_1 = require("./SenderIdentityVerification.js");
12
+ Object.defineProperty(exports, "SenderIdentityVerification", { enumerable: true, get: function () { return SenderIdentityVerification_js_1.SenderIdentityVerification; } });
13
+ var config_js_1 = require("./config.js");
14
+ Object.defineProperty(exports, "loadConfigFromEnv", { enumerable: true, get: function () { return config_js_1.loadConfigFromEnv; } });
15
+ var errors_js_1 = require("./errors.js");
16
+ Object.defineProperty(exports, "SenderVerificationError", { enumerable: true, get: function () { return errors_js_1.SenderVerificationError; } });
17
+ Object.defineProperty(exports, "handleSenderError", { enumerable: true, get: function () { return errors_js_1.handleSenderError; } });
18
+ var types_js_1 = require("./types.js");
19
+ Object.defineProperty(exports, "SenderStatus", { enumerable: true, get: function () { return types_js_1.SenderStatus; } });
20
+ Object.defineProperty(exports, "EmailProvider", { enumerable: true, get: function () { return types_js_1.EmailProvider; } });
21
+ var manual_instructions_js_1 = require("./manual-instructions.js");
22
+ Object.defineProperty(exports, "getManualInstructions", { enumerable: true, get: function () { return manual_instructions_js_1.getManualInstructions; } });
23
+ Object.defineProperty(exports, "isManualVerificationProvider", { enumerable: true, get: function () { return manual_instructions_js_1.isManualVerificationProvider; } });
@@ -0,0 +1,9 @@
1
+ import { EmailProvider } from './types.js';
2
+ export interface ManualVerificationInstruction {
3
+ provider: EmailProvider;
4
+ title: string;
5
+ steps: string[];
6
+ dashboardUrl?: string;
7
+ }
8
+ export declare function getManualInstructions(provider: EmailProvider): ManualVerificationInstruction | null;
9
+ export declare function isManualVerificationProvider(provider: EmailProvider): boolean;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getManualInstructions = getManualInstructions;
11
+ exports.isManualVerificationProvider = isManualVerificationProvider;
12
+ const types_js_1 = require("./types.js");
13
+ const MANUAL_INSTRUCTIONS = {
14
+ [types_js_1.EmailProvider.SMTP]: {
15
+ provider: types_js_1.EmailProvider.SMTP,
16
+ title: 'SMTP Sender Verification',
17
+ steps: [
18
+ 'Configure your SMTP server to allow sending from this address.',
19
+ 'Ensure SPF records include your SMTP server IP.',
20
+ 'Configure DKIM signing for the domain.',
21
+ 'Mark the sender as verified once DNS records are propagated.',
22
+ ],
23
+ },
24
+ [types_js_1.EmailProvider.SMTP2GO]: {
25
+ provider: types_js_1.EmailProvider.SMTP2GO,
26
+ title: 'SMTP2GO Sender Verification',
27
+ steps: [
28
+ 'Log in to your SMTP2GO dashboard.',
29
+ 'Navigate to Settings → Sender Domains.',
30
+ 'Add and verify the sender domain.',
31
+ 'Mark the sender as verified once domain is confirmed.',
32
+ ],
33
+ dashboardUrl: 'https://app.smtp2go.com/settings/sender_domains/',
34
+ },
35
+ [types_js_1.EmailProvider.MANDRILL]: {
36
+ provider: types_js_1.EmailProvider.MANDRILL,
37
+ title: 'Mandrill Sender Verification',
38
+ steps: [
39
+ 'Log in to your Mandrill dashboard.',
40
+ 'Navigate to Settings → Sending Domains.',
41
+ 'Add and verify the sender domain.',
42
+ 'Mark the sender as verified once domain is confirmed.',
43
+ ],
44
+ dashboardUrl: 'https://mandrillapp.com/settings/sending-domains',
45
+ },
46
+ };
47
+ function getManualInstructions(provider) {
48
+ return MANUAL_INSTRUCTIONS[provider] || null;
49
+ }
50
+ function isManualVerificationProvider(provider) {
51
+ return provider === types_js_1.EmailProvider.SMTP
52
+ || provider === types_js_1.EmailProvider.SMTP2GO
53
+ || provider === types_js_1.EmailProvider.MANDRILL;
54
+ }
@@ -0,0 +1,13 @@
1
+ import { SenderIdentity, SenderIdentityResult } from '../types.js';
2
+ /**
3
+ * Mailgun provider for sender verification
4
+ * Note: Mailgun doesn't have sender-level verification, only domain verification
5
+ */
6
+ export declare class MailgunProvider {
7
+ constructor(_apiKey: string);
8
+ /**
9
+ * Verify sender with Mailgun
10
+ * Mailgun only verifies domains, not individual senders
11
+ */
12
+ verifySender(_sender: SenderIdentity): Promise<SenderIdentityResult<Record<string, unknown>>>;
13
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.MailgunProvider = void 0;
11
+ /**
12
+ * Mailgun provider for sender verification
13
+ * Note: Mailgun doesn't have sender-level verification, only domain verification
14
+ */
15
+ class MailgunProvider {
16
+ constructor(_apiKey) {
17
+ // apiKey parameter reserved for future Mailgun API integration
18
+ void _apiKey;
19
+ }
20
+ /**
21
+ * Verify sender with Mailgun
22
+ * Mailgun only verifies domains, not individual senders
23
+ */
24
+ async verifySender(_sender) {
25
+ // Mailgun doesn't require individual sender verification
26
+ // Domain verification is handled by @bernierllc/email-domain-verification
27
+ return {
28
+ success: true,
29
+ data: {
30
+ note: 'Mailgun does not require individual sender verification'
31
+ }
32
+ };
33
+ }
34
+ }
35
+ exports.MailgunProvider = MailgunProvider;
@@ -0,0 +1,12 @@
1
+ import { SenderIdentity, SenderIdentityResult } from '../types.js';
2
+ /**
3
+ * AWS SES provider for sender verification
4
+ */
5
+ export declare class SESProvider {
6
+ constructor(_accessKey: string, _secretKey: string, _region: string);
7
+ /**
8
+ * Verify sender with AWS SES
9
+ * TODO: Implement AWS SDK integration for SES VerifyEmailIdentity
10
+ */
11
+ verifySender(_sender: SenderIdentity): Promise<SenderIdentityResult<Record<string, unknown>>>;
12
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SESProvider = void 0;
11
+ /**
12
+ * AWS SES provider for sender verification
13
+ */
14
+ class SESProvider {
15
+ constructor(_accessKey, _secretKey, _region) {
16
+ // Parameters reserved for future AWS SDK integration
17
+ void _accessKey;
18
+ void _secretKey;
19
+ void _region;
20
+ }
21
+ /**
22
+ * Verify sender with AWS SES
23
+ * TODO: Implement AWS SDK integration for SES VerifyEmailIdentity
24
+ */
25
+ async verifySender(_sender) {
26
+ try {
27
+ // TODO: Call SES VerifyEmailIdentity API
28
+ // For now, return success (stub implementation)
29
+ // Real implementation would use AWS SDK:
30
+ // const ses = new SES({ region: this.region, credentials: {...} });
31
+ // await ses.verifyEmailIdentity({ EmailAddress: sender.email });
32
+ return {
33
+ success: true,
34
+ data: {
35
+ note: 'SES verification stubbed - AWS SDK integration pending'
36
+ }
37
+ };
38
+ }
39
+ catch (error) {
40
+ return {
41
+ success: false,
42
+ error: error instanceof Error ? error.message : 'SES verification failed'
43
+ };
44
+ }
45
+ }
46
+ }
47
+ exports.SESProvider = SESProvider;
@@ -0,0 +1,12 @@
1
+ import { SenderIdentity, SenderIdentityResult } from '../types.js';
2
+ /**
3
+ * SMTP provider for sender verification
4
+ * Note: SMTP doesn't require provider-level verification
5
+ */
6
+ export declare class SMTPProvider {
7
+ /**
8
+ * Verify sender with SMTP
9
+ * SMTP doesn't require provider verification - just email validation
10
+ */
11
+ verifySender(_sender: SenderIdentity): Promise<SenderIdentityResult<Record<string, unknown>>>;
12
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SMTPProvider = void 0;
11
+ /**
12
+ * SMTP provider for sender verification
13
+ * Note: SMTP doesn't require provider-level verification
14
+ */
15
+ class SMTPProvider {
16
+ /**
17
+ * Verify sender with SMTP
18
+ * SMTP doesn't require provider verification - just email validation
19
+ */
20
+ async verifySender(_sender) {
21
+ // SMTP doesn't require provider-level verification
22
+ return {
23
+ success: true,
24
+ data: {
25
+ note: 'SMTP does not require provider-level verification'
26
+ }
27
+ };
28
+ }
29
+ }
30
+ exports.SMTPProvider = SMTPProvider;
@@ -0,0 +1,19 @@
1
+ import { SenderIdentity, SenderIdentityResult } from '../types.js';
2
+ /**
3
+ * SendGrid provider for sender verification
4
+ */
5
+ export declare class SendGridProvider {
6
+ private apiKey;
7
+ constructor(apiKey: string);
8
+ /**
9
+ * Verify sender with SendGrid
10
+ */
11
+ verifySender(sender: SenderIdentity): Promise<SenderIdentityResult<{
12
+ providerId: string;
13
+ metadata: Record<string, unknown>;
14
+ }>>;
15
+ /**
16
+ * Make SendGrid API request
17
+ */
18
+ private sendGridRequest;
19
+ }
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SendGridProvider = void 0;
11
+ /**
12
+ * SendGrid provider for sender verification
13
+ */
14
+ class SendGridProvider {
15
+ apiKey;
16
+ constructor(apiKey) {
17
+ this.apiKey = apiKey;
18
+ }
19
+ /**
20
+ * Verify sender with SendGrid
21
+ */
22
+ async verifySender(sender) {
23
+ try {
24
+ if (!this.apiKey) {
25
+ return {
26
+ success: false,
27
+ error: 'SendGrid API key not configured'
28
+ };
29
+ }
30
+ // Create verified sender in SendGrid
31
+ const response = await this.sendGridRequest('POST', '/verified_senders', {
32
+ nickname: sender.name,
33
+ from_email: sender.email,
34
+ from_name: sender.name,
35
+ reply_to: sender.replyToEmail,
36
+ reply_to_name: sender.replyToName,
37
+ address: '123 Main St',
38
+ city: 'Anytown',
39
+ state: 'CA', // Must be 2-character state code per SendGrid API requirements
40
+ zip: '12345',
41
+ country: 'US'
42
+ });
43
+ if (!response.success) {
44
+ return {
45
+ success: false,
46
+ error: 'SendGrid verification failed',
47
+ errors: [response.error || 'Unknown SendGrid error']
48
+ };
49
+ }
50
+ return {
51
+ success: true,
52
+ data: {
53
+ providerId: response.data?.id || '',
54
+ metadata: response.data || {}
55
+ }
56
+ };
57
+ }
58
+ catch (error) {
59
+ return {
60
+ success: false,
61
+ error: error instanceof Error ? error.message : 'SendGrid verification failed'
62
+ };
63
+ }
64
+ }
65
+ /**
66
+ * Make SendGrid API request
67
+ */
68
+ async sendGridRequest(method, path, body) {
69
+ try {
70
+ const response = await fetch(`https://api.sendgrid.com/v3${path}`, {
71
+ method,
72
+ headers: {
73
+ 'Authorization': `Bearer ${this.apiKey}`,
74
+ 'Content-Type': 'application/json'
75
+ },
76
+ body: body ? JSON.stringify(body) : undefined
77
+ });
78
+ const data = await response.json();
79
+ if (!response.ok) {
80
+ return {
81
+ success: false,
82
+ error: data.errors?.[0]?.message || 'SendGrid API error',
83
+ errors: data.errors?.map((e) => e.message)
84
+ };
85
+ }
86
+ return {
87
+ success: true,
88
+ data: data
89
+ };
90
+ }
91
+ catch (error) {
92
+ return {
93
+ success: false,
94
+ error: error instanceof Error ? error.message : 'SendGrid request failed'
95
+ };
96
+ }
97
+ }
98
+ }
99
+ exports.SendGridProvider = SendGridProvider;
@@ -0,0 +1,9 @@
1
+ import { SenderIdentity } from '../types.js';
2
+ /**
3
+ * Build HTML verification email
4
+ */
5
+ export declare function buildVerificationEmailHtml(sender: SenderIdentity, verificationUrl: string): string;
6
+ /**
7
+ * Build plain text verification email
8
+ */
9
+ export declare function buildVerificationEmailText(sender: SenderIdentity, verificationUrl: string): string;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.buildVerificationEmailHtml = buildVerificationEmailHtml;
11
+ exports.buildVerificationEmailText = buildVerificationEmailText;
12
+ /**
13
+ * Build HTML verification email
14
+ */
15
+ function buildVerificationEmailHtml(sender, verificationUrl) {
16
+ return `
17
+ <!DOCTYPE html>
18
+ <html>
19
+ <head>
20
+ <style>
21
+ body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
22
+ .container { max-width: 600px; margin: 0 auto; padding: 20px; }
23
+ .button { background-color: #007bff; color: white; padding: 12px 24px; text-decoration: none; border-radius: 4px; display: inline-block; margin: 20px 0; }
24
+ .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 12px; color: #666; }
25
+ </style>
26
+ </head>
27
+ <body>
28
+ <div class="container">
29
+ <h1>Verify Your Sender Email Address</h1>
30
+ <p>Hello ${sender.name},</p>
31
+ <p>You've added <strong>${sender.email}</strong> as a sender email address for ${sender.provider}.</p>
32
+ <p>To complete the verification process, please click the button below:</p>
33
+ <a href="${verificationUrl}" class="button">Verify Email Address</a>
34
+ <p>Or copy and paste this URL into your browser:</p>
35
+ <p>${verificationUrl}</p>
36
+ <p><strong>This link will expire in 24 hours.</strong></p>
37
+ <div class="footer">
38
+ <p>If you didn't request this verification, please ignore this email.</p>
39
+ <p>Sender ID: ${sender.id}</p>
40
+ </div>
41
+ </div>
42
+ </body>
43
+ </html>
44
+ `;
45
+ }
46
+ /**
47
+ * Build plain text verification email
48
+ */
49
+ function buildVerificationEmailText(sender, verificationUrl) {
50
+ return `
51
+ Verify Your Sender Email Address
52
+
53
+ Hello ${sender.name},
54
+
55
+ You've added ${sender.email} as a sender email address for ${sender.provider}.
56
+
57
+ To complete the verification process, please visit:
58
+
59
+ ${verificationUrl}
60
+
61
+ This link will expire in 24 hours.
62
+
63
+ If you didn't request this verification, please ignore this email.
64
+
65
+ Sender ID: ${sender.id}
66
+ `.trim();
67
+ }