Commit ec5b5c09 authored by Till Brehm's avatar Till Brehm

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
parents 4478c77f aff959d5
......@@ -348,8 +348,7 @@ class page_action extends tform_actions {
$sql = "SELECT * FROM client_message_template WHERE template_type = 'welcome' AND sys_groupid = ?";
$email_template = $app->db->queryOneRecord($sql, $client_group_id);
$client = $app->tform->getDataRecord($this->id);
if(is_array($email_template) && $client['email'] != '') {
if(is_array($email_template) && $email_template['subject'] != '' && $email_template['message'] != '' && $client['email'] != '') {
//* Parse client details into message
$message = $email_template['message'];
$subject = $email_template['subject'];
......
......@@ -78,6 +78,9 @@ $form["tabs"]['template'] = array (
'subject' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'subject_error_empty'),
),
'default' => '',
'value' => '',
'separator' => '',
......@@ -89,6 +92,9 @@ $form["tabs"]['template'] = array (
'message' => array (
'datatype' => 'TEXT',
'formtype' => 'TEXTAREA',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'message_error_empty'),
),
'default' => '',
'value' => '',
'separator' => '',
......
......@@ -8,4 +8,6 @@ $wb['Settings'] = 'Einstellung';
$wb['variables_txt'] = 'Variable';
$wb['variables_description_txt'] = '(Die Benutzername und Passwort Variable können nur in Willkommensnachrichten verwendet werden.)';
$wb['duplicate_welcome_error'] = 'Es kann nur eine Standard Willkommensnachrichten Vorlage geben. Bitte bearbeiten Sie die bestehende Vorlage anstatt eine neue hinzuzufügen.';
$wb['subject_error_empty'] = 'Betreff ist leer';
$wb['message_error_empty'] = 'Nachricht ist leer';
?>
......@@ -8,4 +8,6 @@ $wb['Settings'] = 'Setting';
$wb['variables_txt'] = 'Variables';
$wb['variables_description_txt'] = '(The username and password variables are only available in welcome emails.)';
$wb['duplicate_welcome_error'] = 'There can be only one default welcome email template. Please edit the existing template instead of adding a new one.';
?>
\ No newline at end of file
$wb['subject_error_empty'] = 'Subject is empty';
$wb['message_error_empty'] = 'Message is empty';
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment