File tree 2 files changed +13
-1
lines changed
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)
16
16
17
17
$ email ->variables = json_encode ($ email ->getVariables ());
18
18
19
- $ email ->scheduled_at = $ email ->getScheduledDateAsCarbon ()->toDateTimeString ();
19
+ if ($ email ->hasScheduledDate ()) {
20
+ $ email ->scheduled_at = $ email ->getScheduledDateAsCarbon ()->toDateTimeString ();
21
+ }
20
22
21
23
$ this ->email ->encrypted = config ('laravel-database-emails.encrypt ' , false );
22
24
Original file line number Diff line number Diff line change @@ -174,6 +174,16 @@ public function getAttempts()
174
174
return $ this ->attempts ;
175
175
}
176
176
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
+
177
187
/**
178
188
* Get the scheduled date as a Carbon instance.
179
189
*
You can’t perform that action at this time.
0 commit comments