Add hours precision when email is dispatched #2576
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request (PR) adds the functionality to specify hour precision when dispatching emails using MailatorSchedule. Hour precision allows for fine-grained control over when emails are sent, with the ability to specify specific hours or intervals within a 24-hour period.
Changes Made
The following changes have been made in this PR:
Added a new method precision(array $scheduleAtHours) to the MailatorSchedule class.
The precision method accepts an array of hours or intervals within the range of 1 to 24.
The specified hours or intervals are stored in the schedule_at_hours property of the MailatorSchedule instance.
The precision method returns the updated MailatorSchedule instance to allow for method chaining.
Additional Notes
Hour precision allows for greater control and customization when scheduling and dispatching emails using
Example Usage
To illustrate the usage of hour precision:
Setting ->precision([1]) would schedule email dispatch at 1 AM.
Setting ->precision([2]) would schedule email dispatch at 2 AM.
Setting ->precision([3-4]) would schedule email dispatch between 3-4 AM.
Users can continue this pattern by specifying the desired hour(s) within the range of 1 to 24.
MailatorSchedule.
The precision range for specifying hours or intervals is from 1 to 24, covering the entire 24-hour period.
The MailatorSchedule class has been extended to provide enhanced flexibility and precision in email dispatching.
Please review this PR at your earliest convenience.