send-button : fix remplissage date et changement de statut à l'envoi
All checks were successful
Deploy / Deploy to Production (push) Successful in 6s
All checks were successful
Deploy / Deploy to Production (push) Successful in 6s
Les appels update() et changeStatus() étaient placés après le return, donc jamais exécutés. Déplacés avant le return dans le bloc try. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2e6c46719a
commit
72031c6c09
1 changed files with 8 additions and 7 deletions
|
|
@ -62,6 +62,14 @@ return [
|
|||
try {
|
||||
$response = $mailersend->bulkEmail->send($bulkEmailParams);
|
||||
file_put_contents($emailPage->root() . '/mailersend_log.json', json_encode($response, JSON_PRETTY_PRINT));
|
||||
|
||||
if (!$data->isTest) {
|
||||
$emailPage->update([
|
||||
'published' => Kirby\Toolkit\Date::today()->format('Y-m-d'),
|
||||
]);
|
||||
$emailPage->changeStatus('listed');
|
||||
}
|
||||
|
||||
return json_encode([
|
||||
'status' => 'success',
|
||||
'message' => 'All emails sent successfully.',
|
||||
|
|
@ -78,12 +86,5 @@ return [
|
|||
'message' => 'Erreur enregistrée dans le log : ' . $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$data->isTest) {
|
||||
$emailPage->update([
|
||||
'published' => Kirby\Toolkit\Date::Today(),
|
||||
]);
|
||||
$emailPage->changeStatus('listed');
|
||||
}
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue