Skip to content

Commit

Permalink
email: Account for possible Orphaned SMTP Accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
protich committed Nov 30, 2022
1 parent eac9960 commit 10af29a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/staff/settings-emails.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,17 @@
<?php
$accounts = SmtpAccount::objects()->filter(['active' => 1]);
foreach ($accounts as $account) {
if (!($email=$account->getEmail()))
continue;

$id = $account->getId();
$email = sprintf('%s &lt;%s&gt;',
$account->email->getName(),
$account->email->getEmail());
$addr = sprintf('%s &lt;%s&gt;',
$email->getName(),
$email->getEmail());
?>
<option value="<?php echo $id; ?>"<?php
echo ($config['default_smtp_id'] == $id) ? 'selected="selected"' : ''; ?>><?php
echo $email; ?></option>
echo $addr; ?></option>
<?php
}
?>
Expand Down

0 comments on commit 10af29a

Please sign in to comment.