File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ public function __construct(Email $email)
1616
1717 $ email ->variables = json_encode ($ email ->getVariables ());
1818
19- $ email ->scheduled_at = $ email ->getScheduledDateAsCarbon ()->toDateTimeString ();
19+ if ($ email ->hasScheduledDate ()) {
20+ $ email ->scheduled_at = $ email ->getScheduledDateAsCarbon ()->toDateTimeString ();
21+ }
2022
2123 $ this ->email ->encrypted = config ('laravel-database-emails.encrypt ' , false );
2224
Original file line number Diff line number Diff line change @@ -174,6 +174,16 @@ public function getAttempts()
174174 return $ this ->attempts ;
175175 }
176176
177+ /**
178+ * Determine if a scheduled date has been set.
179+ *
180+ * @return bool
181+ */
182+ public function hasScheduledDate ()
183+ {
184+ return !is_null ($ this ->getScheduledDate ());
185+ }
186+
177187 /**
178188 * Get the scheduled date as a Carbon instance.
179189 *
You can’t perform that action at this time.
0 commit comments