updated offers expiration hanling with separate checkbox for each 3 offers

This commit is contained in:
asus
2024-04-16 16:43:11 +02:00
parent d3e0fbb99e
commit 62dcaa7672
8 changed files with 72 additions and 145 deletions

View File

@@ -105,6 +105,9 @@ function send_emails_CIPF($email_name, $user_id = null) {
}
foreach ($emails as $email) {
// dont delete, for log
error_log("send '".$email_name."' email to: ".$email['to']." (".json_encode($email).")");
$sent = wp_mail($email['to'], $email['subject'], $email['message'], $email['headers']);
if (!$sent) {
error_log('Email sending failed!: ' . json_encode($email));
@@ -144,6 +147,7 @@ function handle_send_reminders_CIPF($acf_id, $user_id, $date_limit, $reminder_ty
continue;
}
set_email_reminder_choice_CIPF($reminder_key, $acf_id);
send_emails_CIPF($email_type, $user_id);
return; // don't send multiple emails
}