Overview
Understanding the core of Posta’s content management system
Posta’s content management system is built around Assets and Asset Versions. This structure enables efficient content management, version control, and seamless updates to your mail communications.
Asset and Asset Version
An Asset serves as a container for your mailing content, providing a stable reference point. Asset Versions contain the actual content, allowing you to iterate while maintaining a history of changes.
Types
Posta supports four types of Assets:
Images and fonts can be used in templates as variables by referencing their assetId. This ensures these assets are available for rendering while keeping them secure without public exposure.
Statuses
Both Assets and Asset Versions share the same set of statuses, but with different transition rules:
draft
- In development and modifiable.published
- Finalized and available for use.archived
- No longer active but retained for reference.deleted
- Removed from the system.
Schemas
Asset object
For more details on Asset properties, refer to the Asset object schema
Asset Version object
For more details on Asset properties, refer to the Asset object schema
Lifecycle: Asset Version
Only one Asset Version can be published at a time. Publishing a new version automatically archives the previously published one.
Lifecycle: Asset
The status of an Asset is derived from its Asset Version(s) but follows its own transition rules:
published
- Has a published Asset Version.draft
- Has no published Asset Version, but at least one draft.archived
- All Asset Versions are archived.deleted
- All Asset Versions are deleted.
published
and archived
Assets can re-enter Draft status on the Asset but not on Asset version.
Variables
Template Assets support variables for dynamic content personalization. Defining variables is optional and doing it can provide a lot more control to ensure consistent and predictable rendering.
Variables are defined in Asset Versions with the following properties:
List of variables defined for this Asset Version. Used for content personalization in HTML templates. A maximum of 128 variable definitions can be specified per Asset Version. This limit helps maintain performance and readability of templates.
Name of the variable. Used as the key for content personalization.
Must be unique within the Asset Version.
Example: firstName
Specifies the type of the variable:
value
: A string value (default variable type when not specified)asset
: References another Asset by its IdexternalUrl
: References content at an external URL (must be publicly available)
Note: We recommend using asset
type variables instead of externalUrl
for better consistency,
security, compliance, and availability. External URLs might change without version control,
may be subject to throttling, or could become unavailable.
Specifies how the variable should be handled during rendering:
optional
: The variable is optional and may or may not be provided.required
: The variable must be provided.preset
: The preset value will be used. ThepresetValue
must be set when this behavior is used. If a value is specified, the rendering of the document will fail.overridablePreset
: The preset value will be used, unless a different value is explicitly set to override the preset value. ThepresetValue
must be set when this behavior is used.
Determines whether an empty value is acceptable for this variable.
Example empty string: { "name": "firstName", "value": "" }
Note: null
is considered as no value, not an empty one.
Specifies a preset value for the variable. This value may be used when:
- the variable is not provided
- a value is provided but the behavior is set to
preset
Example: "ast_2k1UXnFem92yBFKxtTkQQYhVWyr"
Provides a sample value for the variable, useful for documentation and UI purposes. This value is not used in the actual rendering process. It’s primarily for demonstrating expected input in user interfaces or documentation.
Example: "Jane"
Use asset
type variables for reusable content blocks or images, and be cautious with externalUrl
variables as they depend on external resources.
Best Practices
- Create new Asset Versions for significant changes to maintain a clear content history.
- Use descriptive names and metadata for easy Asset management.
- Regularly audit and clean up unused Assets to keep your library manageable.
- Design variables with reusability in mind, using consistent naming conventions across templates.
By leveraging these concepts and best practices, you can create an efficient content management workflow using Posta’s Asset and Asset Version system.
Next steps
Now that you have an overview of our Asset system, you can:
- Learn how to create and manage Assets
- Explore working with Asset Versions
By leveraging the power of Assets, Asset Versions, and variables, you can create highly dynamic and personalized content for your users. Remember to refer to our API reference for detailed information on available endpoints and operations.