Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/segments/manage_segments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,22 @@

Once you have selected the field, you can then choose the type of operation to perform. These vary depending on the way you wish to filter your Contacts.

.. vale off

In the last and In the next
===========================

.. vale on

The **In the last** and **In the next** operators let you build rolling date filters that never need manual updates. Instead of an absolute date, you enter a whole number for the interval and choose a unit of **days**, **months**, or **years**.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documented the two new inLast/inNext operators and their interval+unit input added in this PR. The unit choices (days/months/years only — no weeks) come from DateSpanType.php choices; the NotBlank + Positive integer constraint (blank/zero/negative/non-integer all rejected) is from DateSpanType.php and the validation-message test data in ListControllerFunctionalTest.php. Field coverage (standard contact date fields, date/datetime Custom Fields on Contact and Company, and behavior date fields such as Read any email (date)) comes from OperatorListTrait.php and FilterOperatorSubscriber.php.

Source: mautic/mautic#16574


* **In the last** matches Contacts whose date value falls within the interval leading up to today. For example, ``In the last`` ``7`` ``days`` keeps the Segment scoped to Contacts whose date value is within the past week every time the Segment rebuilds.
* **In the next** matches Contacts whose date value falls between today and the end of the interval. For example, ``In the next`` ``2`` ``months`` includes Contacts whose date value falls within the coming two months.

These operators work with date and date/time fields. This includes the standard **Date added**, **Date identified**, **Date modified**, and **Date last active** fields, any Custom Field of type date or date/time on a Contact or Company, and behavioral date fields such as **Read any email (date)**.

Check warning on line 414 in docs/segments/manage_segments.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Parens] Use parentheses judiciously. Raw Output: {"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/segments/manage_segments.rst", "range": {"start": {"line": 414, "column": 290}}}, "severity": "INFO"}

Check warning on line 414 in docs/segments/manage_segments.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Email' instead of 'email'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Email' instead of 'email'.", "location": {"path": "docs/segments/manage_segments.rst", "range": {"start": {"line": 414, "column": 284}}}, "severity": "INFO"}

The interval must be a whole number greater than zero. If you leave it blank or enter zero, a negative number, or a value that isn't a whole number, Mautic shows a validation error and won't save the Segment.

Operators for select fields
===========================

Expand Down
Loading