Closed iparr closed 7 months ago
Thanks for reporting this.
.status('sent')
in the docs.As per the docs at https://putyourlightson.com/plugins/campaign#getting-sendouts:
In addition to supporting the parameters that all element types in Craft support (
id
,title
, etc.), the returned Element Query also supports the following parameters.
This means that craft.campaign.sendouts
, which returns an element query, can also take parameters such as status
, orderBy
, limit
, offset
, etc.
As for the properties and methods available on sendouts, I started documenting them only to realise that there are far too many to document. Craft doesn’t document all properties and methods on the core element types either, although they do exist in the class reference. So I’ve updated the docs to reference the appropriate class which contains all public properties and methods. See https://putyourlightson.com/plugins/campaign#outputting-sendouts
Let me know if that’s clear and if you see any more room for improvement.
Here: https://putyourlightson.com/plugins/campaign#getting-sendouts
The following line in the code example does not seem to work:
{% set sendouts = craft.campaign.sendouts.sendoutType('sent').campaignId(5).all %}
However, changing this the following way does give the desirable results:
{% set sendouts = craft.campaign.sendouts.status('sent').campaignId(5).all %}
I'm just checking:
It would be nice to see
craft.campaign.sendouts
options documented more extensively (such as ordering, etc.) if at all possible because it looks like a really powerful template hook (for example, I am usingcraft.campaign.sendouts.status('sent').campaignId(campaign.id).one().sendDate
to get the date on which a campaign was last sent.