Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hours precision when email is dispatched #2576

Merged
merged 4 commits into from
Jun 30, 2023

Conversation

CaReS0107
Copy link
Contributor

@CaReS0107 CaReS0107 commented Jun 27, 2023

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.

@CaReS0107 CaReS0107 force-pushed the schedule-with-precision branch 2 times, most recently from d5dd130 to 071ebd4 Compare June 27, 2023 16:27
@CaReS0107 CaReS0107 force-pushed the schedule-with-precision branch from 71c401b to a7cf486 Compare June 27, 2023 16:32
@CaReS0107 CaReS0107 changed the title Add hour precision when email is dispatched Add hours precision when email is dispatched Jun 27, 2023
Copy link
Contributor

@binaryk binaryk left a comment

Choose a reason for hiding this comment

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

Need to update the readme. And make sure tests passes.

use Binarcode\LaravelMailator\Models\MailatorLog;
use Binarcode\LaravelMailator\Models\MailatorSchedule;

class AlterSchedulerAtHoursColumnTables extends Migration
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be here since the column is in the main migration.

@CaReS0107 CaReS0107 force-pushed the schedule-with-precision branch 2 times, most recently from 538f5b0 to d2c1bae Compare June 28, 2023 19:48
@CaReS0107 CaReS0107 requested a review from binaryk June 28, 2023 19:51
@CaReS0107 CaReS0107 force-pushed the schedule-with-precision branch from c78cd0d to f573b97 Compare June 28, 2023 20:00
@binaryk binaryk merged commit 1e4909c into BinarCode:master Jun 30, 2023
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.

2 participants