From bc3a7750c366d22ac69561d645312b794b312b84 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sat, 06 Feb 2016 03:43:40 -0500
Subject: [PATCH] Merge branch 'html_welcome_mail' into 'stable-3.1'
---
server/plugins-available/mail_plugin.inc.php | 18 +++++++++++++++---
LICENSE | 25 +++++++++++++++++++++++++
README.md | 10 ++++++++++
3 files changed, 50 insertions(+), 3 deletions(-)
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..139b12f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2007-2016, Till Brehm, ISPConfig UG
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of ISPConfig nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4676d2b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,10 @@
+# ISPConfig - Hosting Control Panel
+
+- Manage multiple servers from one control panel
+- Web server management (Apache2 and nginx)
+- Mail server management (with virtual mail users)
+- DNS server management (BIND and MyDNS)
+- Virtualization (OpenVZ)
+- Administrator, reseller and client login
+- Configuration mirroring and clusters
+- Open Source software (BSD license)
\ No newline at end of file
diff --git a/server/plugins-available/mail_plugin.inc.php b/server/plugins-available/mail_plugin.inc.php
index 20388a4..8696205 100644
--- a/server/plugins-available/mail_plugin.inc.php
+++ b/server/plugins-available/mail_plugin.inc.php
@@ -207,7 +207,14 @@
//* Send the welcome email message
$domain = explode('@', $data["new"]["email"])[1];
- if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.txt')) {
+ $html = false;
+ if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.html')) {
+ $lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.html');
+ $html = true;
+ } elseif(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.html')) {
+ $lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.html');
+ $html = true;
+ } elseif(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.txt')) {
$lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.txt');
} elseif(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt')) {
$lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt');
@@ -236,8 +243,13 @@
unset($tmp);
$mailHeaders = "MIME-Version: 1.0" . "\n";
- $mailHeaders .= "Content-type: text/plain; charset=utf-8" . "\n";
- $mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n";
+ if($html) {
+ $mailHeaders .= "Content-Type: text/html; charset=utf-8" . "\n";
+ $mailHeaders .= "Content-Transfer-Encoding: quoted-printable" . "\n";
+ } else {
+ $mailHeaders .= "Content-Type: text/plain; charset=utf-8" . "\n";
+ $mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n";
+ }
$mailHeaders .= "From: $welcome_mail_from" . "\n";
$mailHeaders .= "Reply-To: $welcome_mail_from" . "\n";
$mailTarget = $data["new"]["email"];
--
Gitblit v1.9.1