File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ public function __construct(
105
105
106
106
/**
107
107
* Handles asynchronous email sending
108
+ *
108
109
* @return void
109
110
*/
110
111
public function sendEmails ()
@@ -137,6 +138,9 @@ public function sendEmails()
137
138
'email_sent '
138
139
);
139
140
} else {
141
+ // When the email is failed to send, the email_sent attribute
142
+ // should be set to false, preventing this email from being
143
+ // sent over and over again in the next cron runs.
140
144
$ this ->entityResource ->saveAttribute (
141
145
$ item ->setEmailSent (false ),
142
146
'email_sent '
Original file line number Diff line number Diff line change @@ -256,6 +256,12 @@ public function testExecute(
256
256
->expects ($ this ->once ())
257
257
->method ('saveAttribute ' )
258
258
->with ($ collectionItem );
259
+ } else {
260
+ $ collectionItem
261
+ ->expects ($ this ->once ())
262
+ ->method ('setEmailSent ' )
263
+ ->with (false )
264
+ ->willReturn ($ collectionItem );
259
265
}
260
266
}
261
267
}
You can’t perform that action at this time.
0 commit comments