Skip to content

Commit

Permalink
Add setting "send_inscription_msg_to_inbox" see BT#14034
Browse files Browse the repository at this point in the history
Send inscription message by email and to the chamilo inbox
  • Loading branch information
jmontoyaa committed Feb 19, 2018
1 parent 980467c commit 6e619d2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
41 changes: 29 additions & 12 deletions main/inc/lib/usermanager.lib.php
Expand Up @@ -544,18 +544,35 @@ public static function create_user(
$additionalParameters
);
} else {
api_mail_html(
$recipient_name,
$email,
$emailSubject,
$emailBody,
$sender_name,
$email_admin,
null,
null,
null,
$additionalParameters
);
$sendToInbox = api_get_configuration_value('send_inscription_msg_to_inbox');
if ($sendToInbox) {
$adminList = UserManager::get_all_administrators();
$senderId = 1;
if (!empty($adminList)) {
$adminInfo = current($adminList);
$senderId = $adminInfo['user_id'];
}

MessageManager::send_message_simple(
$userId,
$emailSubject,
$emailBody,
$senderId
);
} else {
api_mail_html(
$recipient_name,
$email,
$emailSubject,
$emailBody,
$sender_name,
$email_admin,
null,
null,
null,
$additionalParameters
);
}
}

$notification = api_get_configuration_value('send_notification_when_user_added');
Expand Down
4 changes: 4 additions & 0 deletions main/install/configuration.dist.php
Expand Up @@ -768,6 +768,10 @@
// Hide exercise question label (ribbon) BT#13950
//$_configuration['exercise_hide_label'] = false;

// Send welcome message by email and to the chamilo inbox BT#14034
//$_configuration['send_inscription_msg_to_inbox'] = false;


// ------ Custom DB changes
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email
Expand Down

0 comments on commit 6e619d2

Please sign in to comment.