Fixed emails (#3189)

* Fix email settings form not toggling between input boxes

* Fix deprecated call to $di['config']
This commit is contained in:
Yağızhan Burak Yakar authored and GitHub committed 2026-01-19 14:27:57 -08:00
1 parent 9537c3b522
commit 9ce7ffe4bd
2 files changed
+26 -28

No files matched your search

+2 -2
View File
@@ -125,7 +125,7 @@ class Service implements \FOSSBilling\InjectionAwareInterface
public function setVars($t, $vars): bool
{
$t->vars = $this->di['crypt']->encrypt(json_encode($vars), $this->di['config']['salt']);
$t->vars = $this->di['crypt']->encrypt(json_encode($vars), Config::getProperty('info.salt'));
$this->di['db']->store($t);
return true;
@@ -136,7 +136,7 @@ class Service implements \FOSSBilling\InjectionAwareInterface
*/
public function getVars($t): array
{
$json = $this->di['crypt']->decrypt($t->vars, $this->di['config']['salt']);
$json = $this->di['crypt']->decrypt($t->vars, Config::getProperty('info.salt'));
return is_string($json) ? json_decode($json, true) : [];
}
@@ -406,36 +406,34 @@
event.preventDefault();
});
document.addEventListener('DOMContentLoaded', function() {
const mailerInputs = document.querySelectorAll('#mailer input');
const mailerInputs = document.querySelectorAll('#mailer input');
mailerInputs.forEach(input => {
input.addEventListener('click', function() {
const smtpFieldset = document.querySelector('fieldset.smtp');
const sendgridFieldset = document.querySelector('fieldset.sendgrid');
const customFieldset = document.querySelector('fieldset.custom');
mailerInputs.forEach(input => {
input.addEventListener('click', function() {
const smtpFieldset = document.querySelector('fieldset.smtp');
const sendgridFieldset = document.querySelector('fieldset.sendgrid');
const customFieldset = document.querySelector('fieldset.custom');
// Handle SMTP fieldset.
if (this.value === 'smtp') {
smtpFieldset.style.display = 'block';
} else {
smtpFieldset.style.display = 'none';
}
// Handle SMTP fieldset.
if (this.value === 'smtp') {
smtpFieldset.style.display = 'block';
} else {
smtpFieldset.style.display = 'none';
}
// Handle SendGrid fieldset.
if (this.value === 'sendgrid') {
sendgridFieldset.style.display = 'block';
} else {
sendgridFieldset.style.display = 'none';
}
// Handle SendGrid fieldset.
if (this.value === 'sendgrid') {
sendgridFieldset.style.display = 'block';
} else {
sendgridFieldset.style.display = 'none';
}
// Handle Custom fieldset.
if (this.value === 'custom') {
customFieldset.style.display = 'block';
} else {
customFieldset.style.display = 'none';
}
});
// Handle Custom fieldset.
if (this.value === 'custom') {
customFieldset.style.display = 'block';
} else {
customFieldset.style.display = 'none';
}
});
});
});