Skip to content

Document Schedule Send for Segment Text Messages - #968

Open
promptless-for-oss wants to merge 1 commit into
mautic:7.3from
Promptless:promptless/pr-17310-segment-sms-schedule-send
Open

Document Schedule Send for Segment Text Messages#968
promptless-for-oss wants to merge 1 commit into
mautic:7.3from
Promptless:promptless/pr-17310-segment-sms-schedule-send

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

Open in Promptless

Mautic 7.x adds an explicit Schedule Send workflow for Segment Text Messages, mirroring the existing Segment Email scheduling. This adds a "Scheduling a Segment Text Message" section to the SMS channel page covering the Schedule button and its preconditions, the Start sending date and time / Continue sending / Stop sending modal controls, one-time versus continuing sends, Update schedule and Cancel schedule, the details-page sending status, and the cron prerequisite. It also reconciles the editor's Publish at / Unpublish at field description, which no longer sets sending times for Segment Text Messages, to point readers to the Schedule button.

Documents mautic/mautic#17310.

Trigger Events

Add a 'Scheduling a Segment Text Message' section to the SMS channel docs
covering the Schedule button, the Start/Continue/Stop modal controls,
one-time vs continuing sends, Update/Cancel schedule, the details-page
status, and the cron prerequisite. Reconcile the editor's Publish/Unpublish
field description to point to the Schedule button.

Documents mautic/mautic#17310.
Comment thread docs/channels/sms.rst

**Contact Segment** - This allows you to define the Segment/s who should receive the Text Message.

.. note::

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.

docs/channels/sms.rst:111-111 at 4642af7

Segment (list) SMS editor hides the publishUp/publishDown date fields (#smsScheduleDates div is hidden when type == 'list') and shows a notice pointing to the Schedule button instead; toggled dynamically in Assets/js/sms.js Mautic.updateSmsScheduleOptions.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Resources/views/Sms/form.html.twig#L92

Comment thread docs/channels/sms.rst
Scheduling a Segment Text Message
=================================

.. vale on

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.

docs/channels/sms.rst:122-122 at 4642af7

Schedule button only rendered when not isEmbedded, scheduleSms.getSmsType() == 'list' (segment SMS), and the User has sms:smses:publishown/publishother entity access; label switches between 'mautic.sms.send.schedule' (Schedule) and 'mautic.sms.send.schedule.update' (Update schedule) based on whether getPublishUp() is set.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Resources/views/Sms/details.html.twig#L32

Comment thread docs/channels/sms.rst

To schedule the send:

#. Open the details page of the Segment Text Message by selecting its name from the Channels > Text Messages list.

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.

docs/channels/sms.rst:130-130 at 4642af7

publishUp field (label mautic.sms.send.datetime.start = "Start sending date and time") is required via NotBlank constraint (line 35).

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Form/Type/ScheduleSendType.php#L25

Comment thread docs/channels/sms.rst

#. Open the details page of the Segment Text Message by selecting its name from the Channels > Text Messages list.
#. Click **Schedule** to open the scheduling modal.
#. Set the following controls:

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.

docs/channels/sms.rst:132-132 at 4642af7

continueSending is a YesNoButtonGroupType field, 'required' => false, defaulting to false ('data' => $options['data']['continueSending'] ?? false) when no prior value exists, i.e. No is the default.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Form/Type/ScheduleSendType.php#L38

Comment thread docs/channels/sms.rst
#. Click **Schedule** to open the scheduling modal.
#. Set the following controls:

* **Start sending date and time** - Required. The date and time when sending begins.

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.

docs/channels/sms.rst:134-134 at 4642af7

publishDown field is only revealed in the UI when continueSending is checked ('data-show-on' => '{"schedule_send_continueSending_1":"checked"}') and is not itself required; Sms::getPublishDown() (Entity/Sms.php L405-412) also forces null for one-time (list, continueSending=false) sends.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Form/Type/ScheduleSendType.php#L47

Comment thread docs/channels/sms.rst

* **Start sending date and time** - Required. The date and time when sending begins.
* **Continue sending** - Shown as a Yes/No question, this controls whether the send continues to include Contacts added to the Segment after sending starts.
* **Stop sending** - Appears only when **Continue sending** is Yes. The optional latest date and time to keep sending.

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.

docs/channels/sms.rst:136-136 at 4642af7

getBasicQuery() adds lll.date_added <= publishUp filter only when !$sms->isContinueSending() && publishUp is set, so a one-time (Continue sending = No) send only picks up Contacts who joined the Segment on/before the start time; late joiners are excluded.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Broadcast/BroadcastQuery.php#L93

Comment thread docs/channels/sms.rst

* **Start sending date and time** - Required. The date and time when sending begins.
* **Continue sending** - Shown as a Yes/No question, this controls whether the send continues to include Contacts added to the Segment after sending starts.
* **Stop sending** - Appears only when **Continue sending** is Yes. The optional latest date and time to keep sending.

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.

docs/channels/sms.rst:136-136 at 4642af7

unpublishCompletedOneTimeSchedule(): once a background-sending, non-continuing SMS has 0 pending Contacts left, it calls $sms->setIsPublished(false) and saves the entity, i.e. auto-unpublishes when the one-time send finishes.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Broadcast/BroadcastExecutioner.php#L182

Comment thread docs/channels/sms.rst
* **Continue sending** - Shown as a Yes/No question, this controls whether the send continues to include Contacts added to the Segment after sending starts.
* **Stop sending** - Appears only when **Continue sending** is Yes. The optional latest date and time to keep sending.

When **Continue sending** is No - the default - Mautic performs a one-time send to the Contacts who are members of the Segment as of the start time. Contacts added to the Segment after the start time aren't included. After Mautic finishes sending to all pending Contacts, Mautic marks the Text Message as unpublished.

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.

docs/channels/sms.rst:138-138 at 4642af7

getPublishDown() returns the actual stop date when continueSending is true (list type); BroadcastQuery omits the date_added upper-bound filter entirely when isContinueSending() is true, so new Segment members keep being picked up until the optional stop time.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Entity/Sms.php#L405

Comment thread docs/channels/sms.rst

When **Continue sending** is Yes, Mautic sends to the Contacts who are Segment members at the start time and continues to include Contacts added to the Segment afterward, until the optional **Stop sending** time.

To change the scheduled times, reopen the modal with **Update schedule**. To clear the schedule, click **Cancel schedule** - cancelling clears the schedule so the Text Message won't send on that schedule. To dismiss the modal without saving changes, click **Close**.

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.

docs/channels/sms.rst:142-142 at 4642af7

SmsController::scheduleSendAction — when the schedule form's 'apply' (Cancel schedule) button is clicked, the controller calls $entity->setPublishUp(null), setPublishDown(null), setContinueSending(false) and saves the entity, i.e. cancelling fully clears the schedule so the Text Message won't send on that schedule. Button labels (Update schedule / Cancel schedule / Close) come from SmsBundle/Form/Type/ScheduleSendType.php buttonOptions when is_scheduled=true.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Controller/SmsController.php#L320-L324

Comment thread docs/channels/sms.rst

To change the scheduled times, reopen the modal with **Update schedule**. To clear the schedule, click **Cancel schedule** - cancelling clears the schedule so the Text Message won't send on that schedule. To dismiss the modal without saving changes, click **Close**.

The publish-status badge on the details page reflects progress: it shows a sending state while Contacts are still pending, and a sent state once a one-time schedule has finished. A continuing send - where **Continue sending** is Yes - keeps showing the sending state until it reaches the optional **Stop sending** time, so a long-running sending state on a continuing send is expected rather than a fault.

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.

docs/channels/sms.rst:144-144 at 4642af7

Sms::getSendingStatus() returns 'sending' while pendingCount > 0 (a continuing send keeps accruing pending Contacts, so it stays in the sending state). It only reaches this branch when getPublishStatus() is 'published'/'unpublished'; once the optional Stop sending time (publishDown) passes, FormEntity::getPublishStatus() (CoreBundle/Entity/FormEntity.php L412-435) returns 'expired' instead, which the publishstatus_badge.html.twig partial renders with a distinct 'sending_expired' label — so the sending badge is bounded by Stop sending as documented.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Entity/Sms.php#L538-L557

Comment thread docs/channels/sms.rst

To change the scheduled times, reopen the modal with **Update schedule**. To clear the schedule, click **Cancel schedule** - cancelling clears the schedule so the Text Message won't send on that schedule. To dismiss the modal without saving changes, click **Close**.

The publish-status badge on the details page reflects progress: it shows a sending state while Contacts are still pending, and a sent state once a one-time schedule has finished. A continuing send - where **Continue sending** is Yes - keeps showing the sending state until it reaches the optional **Stop sending** time, so a long-running sending state on a continuing send is expected rather than a fault.

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.

docs/channels/sms.rst:144-144 at 4642af7

Sms::__clone() nulls publishUp, publishDown and continueSending, then calls parent::__clone(); FormEntity::__clone() (CoreBundle/Entity/FormEntity.php) sets isPublished=false, so a cloned scheduled Segment Text Message is both unpublished and has its schedule fully cleared.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Entity/Sms.php#L151

Comment thread docs/channels/sms.rst

The publish-status badge on the details page reflects progress: it shows a sending state while Contacts are still pending, and a sent state once a one-time schedule has finished. A continuing send - where **Continue sending** is Yes - keeps showing the sending state until it reaches the optional **Stop sending** time, so a long-running sending state on a continuing send is expected rather than a fault.

Cloning a scheduled Segment Text Message produces an unpublished copy with the schedule cleared.

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.

docs/channels/sms.rst:146-146 at 4642af7

The existing generic 'mautic:broadcasts:send' console command (in ChannelBundle, not added by PR #17310) dispatches a ChannelBroadcastEvent that SmsBundle's BroadcastExecutioner::execute() listens for; SmsBundle has no new Command class of its own, confirming Segment SMS scheduling reuses the pre-existing Send Scheduled Broadcast cron mechanism rather than adding a new command.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/ChannelBundle/Command/SendChannelBroadcastCommand.php#L22

Comment thread docs/channels/sms.rst
.. vale on

A Segment Text Message can be manually sent to Contact lists - Segments - in Mautic. Once sent, you can't edit the Text Message, however you can send it to new Contacts as they join the associated Segment.
A Segment Text Message can be manually sent to Contact lists - Segments - in Mautic. Once sent, you can't edit the Text Message. Whether the send continues to Contacts who join the associated Segment later is controlled by the **Continue sending** option when you schedule the send - see :ref:`schedule segment text message`.

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.

docs/channels/sms.rst:34-34 at 4642af7

BroadcastQuery::getBasicQuery() only adds the date_added <= publishUp upper-bound filter when !$sms->isContinueSending(); when continueSending is true (set via the Schedule modal's Continue sending option) that filter is omitted, so Contacts who join the Segment after the send starts are still picked up. Entity/Sms.php L108 defaults continueSending to false, i.e. a one-time send unless Continue sending is explicitly set to Yes when scheduling — confirming the docs' claim that continuing-vs-one-time behavior is controlled by the Continue sending option set at schedule time, not automatic.

Source: https://github.com/mautic/mautic/blob/aea9f82c7214216ed968d4ff119e3e87d531775a/app/bundles/SmsBundle/Broadcast/BroadcastQuery.php#L93-L96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant