Skip to content

Commit 6cc90d3

Browse files
author
Marius Burkard
committed
Merge branch 'domain_specific_welcome_message' into 'stable-3.1'
Allow domain specific welcom messages: * In addition to language specific custom welcome messages (when creating a new mail account) this patch will allow to have a welcome message template for each domain. * To add a domain specific welcome message, place a file at /usr/local/ispconfig/server/conf-custom/mail/ and name it according the domain, like welcome_email_example.com.txt * i.e. /usr/local/ispconfig/server/conf-custom/mail/welcome_email_example.com.txt will be used if a mailbox for example.com is created. See merge request !263
2 parents ba59737 + bb984ce commit 6cc90d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/plugins-available/mail_plugin.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ function user_insert($event_name, $data) {
206206
}
207207

208208
//* Send the welcome email message
209-
if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt')) {
209+
$domain = explode('@', $data["new"]["email"])[1];
210+
if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.txt')) {
211+
$lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.txt');
212+
} elseif(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt')) {
210213
$lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt');
211214
} elseif(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_en.txt')) {
212215
$lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_en.txt');

0 commit comments

Comments
 (0)