fix(email): lock templates to built-in catalog
This commit is contained in:
1 parent
3f02048bc5
commit
129eb25078
10 files changed
+61
-111
No files matched your search
@@ -540,16 +540,12 @@ class SchemaProvider {
|
||||
|
||||
$data = $this->collect_defaults($schema);
|
||||
foreach ($this->get_all_fields($schema) as $field) {
|
||||
if (array_key_exists($field['key'], $stored)) {
|
||||
$stored_value = $stored[$field['key']];
|
||||
$is_mail_template = $option_key === 'aksrt_settings'
|
||||
&& preg_match('/^email_.+_(subject|content)$/', (string) $field['key']);
|
||||
if (!$is_mail_template || trim((string) $stored_value) !== '') {
|
||||
$data[$field['key']] = $stored_value;
|
||||
}
|
||||
}
|
||||
if (array_key_exists($field['key'], $stored)) {
|
||||
$data[$field['key']] = $stored[$field['key']];
|
||||
}
|
||||
|
||||
$stored_value = array_key_exists($field['key'], $stored) ? $stored[$field['key']] : ($data[$field['key']] ?? '');
|
||||
|
||||
if (!empty($field['secret'])) {
|
||||
$data[$field['key']] = trim((string) $stored_value) !== '' ? '***' : '';
|
||||
}
|
||||
|
||||
@@ -205,9 +205,9 @@ trait UserControllerAuthPhoneOperations {
|
||||
'{code}' => $code,
|
||||
];
|
||||
$sent = $scene_event !== '' && class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? \AKSRT\Settings\Settings::send_event_email($scene_event, $target, '', '', $placeholders)
|
||||
? \AKSRT\Settings\Settings::send_event_email($scene_event, $target, $placeholders)
|
||||
: false;
|
||||
|
||||
: false;
|
||||
if (!$sent) {
|
||||
delete_transient($this->auth_code_key($scene, $target));
|
||||
if ($scene !== 'register') {
|
||||
|
||||
Reference in new issue
Block a user