Marius Burkard
2016-02-06 bc3a7750c366d22ac69561d645312b794b312b84
Merge branch 'html_welcome_mail' into 'stable-3.1'

Allow HTML based welcome messages

I needed a HTML based welcome message, so I added this to mail_plugin.inc.php

I hope this is the correct approach.

In addition to /conf-custom/mail/welcome_email_DOMAINNAME.txt and /conf-custom/mail/welcome_email_LANGUAGE.txt one may place a /conf-custom/mail/welcome_email_DOMAINNAME.html or /conf-custom/mail/welcome_email_LANGUAGE.html file to allow HTML based welcome messages.

See merge request !276
2 files added
1 files modified
51 ■■■■■ changed files
LICENSE 25 ●●●●● patch | view | raw | blame | history
README.md 10 ●●●●● patch | view | raw | blame | history
server/plugins-available/mail_plugin.inc.php 16 ●●●● patch | view | raw | blame | history
LICENSE
New file
@@ -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.
README.md
New file
@@ -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)
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";
        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"];