Skip to content

Commit d88165c

Browse files
author
filip
committed
Added admin_name and admin_email to mail system config tab.
Using these variables in welcome email from admin, when mailbox is created.
1 parent c7d6d96 commit d88165c

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

interface/web/admin/form/system_config.tform.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,22 @@
180180
'width' => '30',
181181
'maxlength' => '255'
182182
),
183+
'admin_mail' => array (
184+
'datatype' => 'VARCHAR',
185+
'formtype' => 'TEXT',
186+
'default' => '',
187+
'value' => '',
188+
'width' => '30',
189+
'maxlength' => '255'
190+
),
191+
'admin_name' => array (
192+
'datatype' => 'VARCHAR',
193+
'formtype' => 'TEXT',
194+
'default' => '',
195+
'value' => '',
196+
'width' => '30',
197+
'maxlength' => '255'
198+
),
183199
##################################
184200
# ENDE Datatable fields
185201
##################################
@@ -233,4 +249,4 @@
233249
);
234250

235251

236-
?>
252+
?>

interface/web/admin/lib/lang/cz_system_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ $wb['use_domain_module_txt'] = 'Use the domain-module to add new domains';
1919
$wb['use_domain_module_hint'] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They can not free edit the domain-field.You have to re-login after changing this value, to make the changes visible.';
2020
$wb['new_domain_txt'] = 'HTML to create a new domain';
2121
$wb['webftp_url_txt'] = 'WebFTP URL';
22+
$wb['admin_mail_txt'] = 'E-mail Administrátora';
23+
$wb['admin_name_txt'] = 'Jméno Administrátora';
2224
?>

interface/web/admin/lib/lang/en_system_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ $wb["use_domain_module_txt"] = 'Use the domain-module to add new domains';
1919
$wb["use_domain_module_hint"] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.';
2020
$wb["new_domain_txt"] = 'HTML to create a new domain';
2121
$wb["webftp_url_txt"] = 'WebFTP URL';
22+
$wb['admin_mail_txt'] = 'Administrator's e-mail';
23+
$wb['admin_name_txt'] = 'Administrator's name';
2224
?>

interface/web/admin/templates/system_config_mail_edit.htm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ <h2><tmpl_var name="list_head_txt"></h2>
1515
<label for="webmail_url">{tmpl_var name='webmail_url_txt'}</label>
1616
<input name="webmail_url" id="webmail_url" value="{tmpl_var name='webmail_url'}" size="30" maxlength="255" type="text" class="textInput" />
1717
</div>
18+
<div class="ctrlHolder">
19+
<label for="admin_mail">{tmpl_var name='admin_mail_txt'}</label>
20+
<input name="admin_mail" id="admin_mail" value="{tmpl_var name='admin_mail'}" size="30" maxlength="255" type="text" class="textInput" />
21+
</div>
22+
<div class="ctrlHolder">
23+
<label for="admin_name">{tmpl_var name='admin_name_txt'}</label>
24+
<input name="admin_name" id="admin_name" value="{tmpl_var name='admin_name'}" size="30" maxlength="255" type="text" class="textInput" />
25+
</div>
1826
</fieldset>
1927

2028
<input type="hidden" name="id" value="{tmpl_var name='id'}">

interface/web/mail/mail_user_edit.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@ function onAfterInsert() {
242242

243243
$welcomeFromName = $app->tform->lng("welcome_mail_fromname_txt");
244244
$welcomeFromEmail = $app->tform->lng("welcome_mail_fromemail_txt");
245+
246+
$app->uses('getconf');
247+
$global_config = $app->getconf->get_global_config('mail');
248+
if(!empty($global_config['admin_mail']))$welcomeFromEmail = $global_config['admin_mail'];
249+
if(!empty($global_config['admin_name']))$welcomeFromName = $global_config['admin_name'];
250+
245251
$mailHeaders = "MIME-Version: 1.0" . "\n";
246252
$mailHeaders .= "Content-type: text/plain; charset=utf-8" . "\n";
247253
$mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n";

0 commit comments

Comments
 (0)