Skip to content

Commit ec5b5c0

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' into 'stable-3.1'
prevent incorrectly formatted mails because of empty entries in email templates See merge request ispconfig/ispconfig3!662
2 parents 4478c77 + aff959d commit ec5b5c0

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

interface/web/client/client_edit.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ function onAfterInsert() {
348348
$sql = "SELECT * FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ?";
349349
$email_template = $app->db->queryOneRecord($sql, $client_group_id);
350350
$client = $app->tform->getDataRecord($this->id);
351-
352-
if(is_array($email_template) && $client['email'] != '') {
351+
if(is_array($email_template) && $email_template['subject'] != '' && $email_template['message'] != '' && $client['email'] != '') {
353352
//* Parse client details into message
354353
$message = $email_template['message'];
355354
$subject = $email_template['subject'];

interface/web/client/form/message_template.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
'subject' => array (
7979
'datatype' => 'VARCHAR',
8080
'formtype' => 'TEXT',
81+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
82+
'errmsg'=> 'subject_error_empty'),
83+
),
8184
'default' => '',
8285
'value' => '',
8386
'separator' => '',
@@ -89,6 +92,9 @@
8992
'message' => array (
9093
'datatype' => 'TEXT',
9194
'formtype' => 'TEXTAREA',
95+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
96+
'errmsg'=> 'message_error_empty'),
97+
),
9298
'default' => '',
9399
'value' => '',
94100
'separator' => '',

interface/web/client/lib/lang/de_client_message_template.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ $wb['Settings'] = 'Einstellung';
88
$wb['variables_txt'] = 'Variable';
99
$wb['variables_description_txt'] = '(Die Benutzername und Passwort Variable können nur in Willkommensnachrichten verwendet werden.)';
1010
$wb['duplicate_welcome_error'] = 'Es kann nur eine Standard Willkommensnachrichten Vorlage geben. Bitte bearbeiten Sie die bestehende Vorlage anstatt eine neue hinzuzufügen.';
11+
$wb['subject_error_empty'] = 'Betreff ist leer';
12+
$wb['message_error_empty'] = 'Nachricht ist leer';
1113
?>

interface/web/client/lib/lang/en_client_message_template.lng

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ $wb['Settings'] = 'Setting';
88
$wb['variables_txt'] = 'Variables';
99
$wb['variables_description_txt'] = '(The username and password variables are only available in welcome emails.)';
1010
$wb['duplicate_welcome_error'] = 'There can be only one default welcome email template. Please edit the existing template instead of adding a new one.';
11-
?>
11+
$wb['subject_error_empty'] = 'Subject is empty';
12+
$wb['message_error_empty'] = 'Message is empty';
13+
?>

0 commit comments

Comments
 (0)