@@ -12,7 +12,7 @@ import (
1212 "advrider-notifier/pkg/notifier"
1313)
1414
15- const maxPostsPerEmail = 5 // Safety limit: max posts to include in a single email
15+ const maxPostsPerEmail = 10 // Safety limit: max posts to include in a single email
1616
1717// Scraper interface for fetching thread data.
1818type Scraper interface {
@@ -374,6 +374,7 @@ func (m *Monitor) checkThreadForSubscribers(ctx context.Context, info *threadChe
374374
375375 if len (newPosts ) > 0 {
376376 // Apply safety limit
377+ originalCount := len (newPosts )
377378 if len (newPosts ) > maxPostsPerEmail {
378379 m .logger .Warn ("Too many new posts, limiting to most recent" ,
379380 "cycle" , m .cycleNumber ,
@@ -385,13 +386,15 @@ func (m *Monitor) checkThreadForSubscribers(ctx context.Context, info *threadChe
385386 newPosts = newPosts [len (newPosts )- maxPostsPerEmail :]
386387 }
387388
388- // Send notification
389+ // Send notification with all new posts in a single email
389390 m .logger .Info ("Sending notification" ,
390391 "cycle" , m .cycleNumber ,
391392 "email" , email ,
392393 "thread_url" , threadURL ,
393394 "thread_title" , thread .ThreadTitle ,
394- "new_posts" , len (newPosts ),
395+ "new_posts_count" , len (newPosts ),
396+ "original_count" , originalCount ,
397+ "capped" , originalCount > maxPostsPerEmail ,
395398 "previous_last_post" , thread .LastPostID ,
396399 "new_last_post" , latestPost .ID )
397400
0 commit comments