Commit f951aa99 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

send an email when a user is added to the system

parent 183cd847
...@@ -484,6 +484,7 @@ class tx_nG6_eid { ...@@ -484,6 +484,7 @@ class tx_nG6_eid {
$clearpassword = trim(t3lib_div::_GP('clearpassword')); $clearpassword = trim(t3lib_div::_GP('clearpassword'));
$from_email = trim(t3lib_div::_GP('from_email')); $from_email = trim(t3lib_div::_GP('from_email'));
$pid = trim(t3lib_div::_GP('pid')); $pid = trim(t3lib_div::_GP('pid'));
$project_url = trim(t3lib_div::_GP('project_url'));
// if group not exists, create group // if group not exists, create group
$group_id = tx_nG6_db::get_group_id($group_name); $group_id = tx_nG6_db::get_group_id($group_name);
...@@ -540,7 +541,7 @@ class tx_nG6_eid { ...@@ -540,7 +541,7 @@ class tx_nG6_eid {
$message = str_replace("###USER_LAST_NAME###", $last_name, $message); $message = str_replace("###USER_LAST_NAME###", $last_name, $message);
$message = str_replace("###PROJECT_NAME###", $project["name"], $message); $message = str_replace("###PROJECT_NAME###", $project["name"], $message);
$message = str_replace("###PROJECT_DESCRIPTION###", $project["description"], $message); $message = str_replace("###PROJECT_DESCRIPTION###", $project["description"], $message);
$message = str_replace("###PROJECT_LINK###", "http://lemonde.fr", $message); $message = str_replace("###PROJECT_LINK###", $project_url, $message);
$msg_table = explode('\n', $message); $msg_table = explode('\n', $message);
$message = implode("\n", $msg_table); $message = implode("\n", $msg_table);
mail($email, $add_user_title, $message, "From: <".$from_email.">"); mail($email, $add_user_title, $message, "From: <".$from_email.">");
......
...@@ -1115,6 +1115,7 @@ $(function () { ...@@ -1115,6 +1115,7 @@ $(function () {
val_url += "&create_user_email=" + escape($("#create_user_email").val()); val_url += "&create_user_email=" + escape($("#create_user_email").val());
val_url += "&create_user_title=" + $("#create_user_title").val(); val_url += "&create_user_title=" + $("#create_user_title").val();
val_url += "&from_email=" + $("#from_email").val(); val_url += "&from_email=" + $("#from_email").val();
val_url += "&project_url=" + escape(location.href);
$.ajax({ $.ajax({
url: val_url, url: val_url,
......
Supports Markdown
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