diff --git a/.env.example b/.env.example index 629df24..c3705f7 100644 --- a/.env.example +++ b/.env.example @@ -29,7 +29,7 @@ BREVO_SMTP_HOST=smtp-relay.brevo.com BREVO_SMTP_PORT=587 BREVO_SMTP_USER=9faa1f001@smtp-brevo.com BREVO_SMTP_KEY=your-brevo-smtp-api-key -EMAIL_FROM_ADDRESS=newsletter@yourdomain.com +EMAIL_FROM_ADDRESS=x-news@ksalk.pl EMAIL_FROM_NAME=Daily Tech Digest # Comma-separated recipient list EMAIL_RECIPIENTS=you@example.com @@ -48,5 +48,3 @@ CRON_TIMEZONE=Europe/Warsaw ENABLE_AI_SUMMARIES=true INCLUDE_RETWEETS=false INCLUDE_REPLIES=false -# Set true to skip email sending (for testing) -DRY_RUN=false diff --git a/src/config/accounts.ts b/src/config/accounts.ts index d35210d..db3aa71 100644 --- a/src/config/accounts.ts +++ b/src/config/accounts.ts @@ -51,7 +51,7 @@ const ALL_TECH_ACCOUNTS: TechAccount[] = [ { username: 'jason_f', displayName: 'Jason Fried', category: 'general_tech', priority: 'medium' }, ]; -export const TECH_ACCOUNTS: TechAccount[] = ALL_TECH_ACCOUNTS; +export const TECH_ACCOUNTS: TechAccount[] = ALL_TECH_ACCOUNTS.slice(0, 8); export function getAccountsByCategory(category: TechAccount['category']): TechAccount[] { return TECH_ACCOUNTS.filter((account) => account.category === category); diff --git a/src/config/index.ts b/src/config/index.ts index 05c731f..e6d3d01 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -32,7 +32,6 @@ const envSchema = z.object({ ENABLE_AI_SUMMARIES: z.coerce.boolean().default(true), INCLUDE_RETWEETS: z.coerce.boolean().default(false), INCLUDE_REPLIES: z.coerce.boolean().default(false), - DRY_RUN: z.coerce.boolean().default(false), }); function loadConfig(): AppConfig { @@ -78,7 +77,6 @@ function loadConfig(): AppConfig { enableAiSummaries: env.ENABLE_AI_SUMMARIES, includeRetweets: env.INCLUDE_RETWEETS, includeReplies: env.INCLUDE_REPLIES, - dryRun: env.DRY_RUN, }, logging: { level: env.LOG_LEVEL, diff --git a/src/index.ts b/src/index.ts index 5391638..f5fd2f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,16 +7,10 @@ import { EmailService } from './services/email/EmailService.js'; async function main() { const args = process.argv.slice(2); const runNow = args.includes('--run-now'); - const dryRun = args.includes('--dry-run'); - - if (dryRun) { - process.env.DRY_RUN = 'true'; - } logger.info( { runNow, - dryRun: config.features.dryRun || dryRun, cronSchedule: config.scheduler.cronExpression, timezone: config.scheduler.timezone, recipients: config.email.recipients.length, diff --git a/src/services/email/EmailService.ts b/src/services/email/EmailService.ts index 463b79b..ced16ef 100644 --- a/src/services/email/EmailService.ts +++ b/src/services/email/EmailService.ts @@ -37,22 +37,6 @@ export class EmailService { logger.info({ recipients: recipients.length, subject }, 'Sending newsletter'); - if (config.features.dryRun) { - logger.info('DRY RUN: Skipping email send'); - console.log('\n========== DRY RUN: NEWSLETTER PREVIEW =========='); - console.log(`Subject: ${subject}`); - console.log(`Recipients: ${recipients.join(', ')}`); - console.log('\n--- HTML CONTENT ---\n'); - console.log(html); - console.log('\n================================================\n'); - return { - success: true, - messageId: 'dry-run', - accepted: recipients, - rejected: [], - }; - } - return withRetry( async () => { const info = await this.transporter.sendMail({ diff --git a/src/types/index.ts b/src/types/index.ts index e636820..f38fb90 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -100,7 +100,6 @@ export interface AppConfig { enableAiSummaries: boolean; includeRetweets: boolean; includeReplies: boolean; - dryRun: boolean; }; logging: { level: string;