(data: {
slackChannelId?: string;
workingGroupName: string;
workingGroupSlug: string;
postTitle: string;
postSlug: string;
authorName: string;
contentType: 'article' | 'link';
excerpt?: string;
externalUrl?: string;
category?: string;
isMembersOnly: boolean;
})
| 476 | * @param slackChannelId - The Slack channel ID (required) |
| 477 | */ |
| 478 | export async function notifyPublishedPost(data: { |
| 479 | slackChannelId?: string; |
| 480 | workingGroupName: string; |
| 481 | workingGroupSlug: string; |
| 482 | postTitle: string; |
| 483 | postSlug: string; |
| 484 | authorName: string; |
| 485 | contentType: 'article' | 'link'; |
| 486 | excerpt?: string; |
| 487 | externalUrl?: string; |
| 488 | category?: string; |
| 489 | isMembersOnly: boolean; |
| 490 | }): Promise<void> { |
| 491 | // Skip members-only posts - don't share private content to channels |
| 492 | if (data.isMembersOnly) { |
| 493 | logger.debug({ postSlug: data.postSlug }, 'Skipping Slack notification for members-only post'); |
| 494 | return; |
| 495 | } |
| 496 | |
| 497 | // Skip if no channel ID provided |
| 498 | if (!data.slackChannelId) { |
| 499 | logger.debug( |
| 500 | { workingGroupSlug: data.workingGroupSlug }, |
| 501 | 'No Slack channel configured for working group, skipping notification' |
| 502 | ); |
| 503 | return; |
| 504 | } |
| 505 | |
| 506 | // Send notification (fire-and-forget, errors are logged internally) |
| 507 | await notifyWorkingGroupSlackChannel({ |
| 508 | slackChannelId: data.slackChannelId, |
| 509 | workingGroupName: data.workingGroupName, |
| 510 | workingGroupSlug: data.workingGroupSlug, |
| 511 | postTitle: data.postTitle, |
| 512 | postSlug: data.postSlug, |
| 513 | authorName: data.authorName, |
| 514 | contentType: data.contentType, |
| 515 | excerpt: data.excerpt, |
| 516 | externalUrl: data.externalUrl, |
| 517 | category: data.category, |
| 518 | }); |
| 519 | } |
| 520 | |
| 521 | /** |
| 522 | * Notify a working group's Slack channel when a meeting starts |
no test coverage detected