Backwards compatibility

This commit is contained in:
Matej Bačo
2026-04-20 11:48:45 +02:00
parent bc592903db
commit 56385ce167
2 changed files with 4 additions and 1 deletions
@@ -102,6 +102,9 @@ class Update extends Action
$smtp[$key] = ${$key};
}
}
// Backwards compatibility
$smtp['replyToEmail'] = $smtp['replyToEmail'] ?? $smtp['replyTo'] ?? '';
// Ensure required fields are set
$requiredKeys = ['host', 'port', 'senderEmail'];
@@ -418,7 +418,7 @@ class Project extends Model
$document->setAttribute('smtpEnabled', $smtp['enabled'] ?? false);
$document->setAttribute('smtpSenderEmail', $smtp['senderEmail'] ?? '');
$document->setAttribute('smtpSenderName', $smtp['senderName'] ?? '');
$document->setAttribute('smtpReplyToEmail', $smtp['replyToEmail'] ?? '');
$document->setAttribute('smtpReplyToEmail', $smtp['replyToEmail'] ?? $smtp['replyTo'] ?? ''); // Includes backwards compatibility
$document->setAttribute('smtpReplyToName', $smtp['replyToName'] ?? '');
$document->setAttribute('smtpHost', $smtp['host'] ?? '');
$document->setAttribute('smtpPort', $smtp['port'] ?? '');