Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
<?php
declare(strict_types=1);
use App\Mail\PostPublished;
use App\Models\Post;
use App\Models\SocialAccount;
use App\Models\Workspace;
test('published email falls back to the page display name when facebook has no username', function () {
$workspace = Workspace::factory()->create(['name' => 'InboxPlacement.io']);
$account = SocialAccount::factory()->facebook()->create([
'workspace_id' => $workspace->id,
'username' => null,
'display_name' => 'InboxPlacement.io',
]);
$post = Post::factory()->forAccount($account)->published()->create([
'platform_url' => 'https://www.facebook.com/permalink.php?story_fbid=pfbid0&id=61592851040951',
]);
$mail = new PostPublished($post);
$mail->assertSeeInHtml('Facebook Page');
$mail->assertSeeInHtml('InboxPlacement.io');
$mail->assertDontSeeInHtml('Facebook Page (@)');
$mail->assertSeeInHtml('https://www.facebook.com/permalink.php?story_fbid=pfbid0&id=61592851040951');
});
test('published email uses the username when the display name is empty', function () {
$workspace = Workspace::factory()->create(['name' => 'InboxPlacement.io']);
$account = SocialAccount::factory()->bluesky()->create([
'workspace_id' => $workspace->id,
'username' => 'inboxplacementio.bsky.social',
'display_name' => '',
]);
$post = Post::factory()->forAccount($account)->published()->create();
$mail = new PostPublished($post);
$mail->assertSeeInHtml('Bluesky');
$mail->assertSeeInHtml('inboxplacementio.bsky.social');
$mail->assertDontSeeInHtml('Bluesky (@)');
});
test('published email omits empty parentheses when both identifiers are missing', function () {
$workspace = Workspace::factory()->create(['name' => 'InboxPlacement.io']);
$account = SocialAccount::factory()->facebook()->create([
'workspace_id' => $workspace->id,
'username' => null,
'display_name' => '',
]);
$post = Post::factory()->forAccount($account)->published()->create();
$mail = new PostPublished($post);
$mail->assertSeeInHtml('Facebook Page');
$mail->assertDontSeeInHtml('Facebook Page (@)');
});