Post
A post records one attempt to send an entry to a social media account, including the settings used and the provider’s response. You get posts from a post query, which returns an array of verbb\socialposter\elements\Post objects.
{% set posts = craft.socialPoster.posts()
.ownerId(entry.id)
.all() %}
{% for post in posts %}
<p>{{ post.getAccount().name ?? 'Deleted account' }}: {{ post.success ? 'Sent' : 'Failed' }}</p>
{% endfor %}
Properties
The ID of the account this post was sent from.
The full response data returned by the provider. When sending failed, this holds any error details the provider returned.
The post’s element ID.
The element this post was sent for, usually an entry, or null when that element no longer exists. This reads getOwner().
The ID of the element this post was sent for.
The ID of the site the owner element was sent from.
The class name of the owner element, such as craft\elements\Entry.
A short summary of the provider’s response. When sending failed, it holds the statusCode and reasonPhrase of the error.
The settings used to send this post, such as its title, URL and message.
Whether the post was sent to the provider successfully.
The post’s title, taken from the owner element’s title.
Methods
Returns the Account this post was sent from, or null when the account has been deleted.