Skip to content

Commit

Permalink
cannot use trigger, need dependency on send_mode && smtp_authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Apr 23, 2024
1 parent d660e4a commit 8680c3b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 8 additions & 0 deletions models/MailSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,13 @@ public function filterFields($fields, $context = null)
break;
}
}

$hideAuth = $fields->send_mode->value !== 'smtp' || !$fields->smtp_authorization->value;
if (isset($fields->smtp_user)) {
$fields->smtp_user->hidden = $hideAuth;
}
if (isset($fields->smtp_password)) {
$fields->smtp_password->hidden = $hideAuth;
}
}
}
14 changes: 6 additions & 8 deletions models/mailsetting/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,18 @@ tabs:
label: system::lang.mail.smtp_username
tab: system::lang.mail.general
span: left
trigger:
action: show
field: smtp_authorization
condition: checked
dependsOn:
- send_mode
- smtp_authorization

smtp_password:
label: system::lang.mail.smtp_password
tab: system::lang.mail.general
type: sensitive
span: right
trigger:
action: show
field: smtp_authorization
condition: checked
dependsOn:
- send_mode
- smtp_authorization

sendmail_path:
label: system::lang.mail.sendmail_path
Expand Down

0 comments on commit 8680c3b

Please sign in to comment.