FoPost LogoFoPost Docs
Pro Features

Templates

Reusable post templates with variable substitution.

Templates

Pro

Templates let you define reusable post formats with placeholders that get filled in at publish time.

Creating a template

Via dashboard

Go to Project > Templates in the OwlStack dashboard and click Create Template.

Via API

$template = $client->createTemplate([
    'name' => 'Blog Post Announcement',
    'body' => "📝 New blog post: {{title}}\n\n{{excerpt}}\n\nRead more: {{url}}",
    'hashtags' => ['blog', 'tech'],
]);

Using a template

use OwlStack\Content\Post;
use OwlStack\Enums\Platform;

$post = Post::fromTemplate($template->id(), [
    'title' => 'Getting Started with OwlStack',
    'excerpt' => 'Learn how to publish to 11+ platforms with a single API call.',
    'url' => 'https://example.com/getting-started',
]);

$client->publish($post, [Platform::Twitter, Platform::LinkedIn]);

Template variables

Use {{variable_name}} syntax in your template body. Variables are replaced at publish time.

Default values

$template = $client->createTemplate([
    'name' => 'Product Update',
    'body' => "🚀 {{title}}\n\n{{description}}\n\n{{url|https://example.com}}",
]);

Use {{variable|default}} to set a fallback value.

On this page