forked from science-ation/science-ation
Add support for URLMAIN and URLLOGIN replacement in communications
This commit is contained in:
parent
29b95e97ac
commit
7fc721b96f
@ -652,6 +652,9 @@ case "email_get_list":
|
|||||||
$emailqueueid=mysql_insert_id();
|
$emailqueueid=mysql_insert_id();
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
|
|
||||||
|
$urlproto = $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
|
||||||
|
$urlmain = "$urlproto{$_SERVER['HTTP_HOST']}{$config['SFIABDIRECTORY']}";
|
||||||
|
$urllogin = "$urlmain/login.php";
|
||||||
while($r=mysql_fetch_object($recipq)) {
|
while($r=mysql_fetch_object($recipq)) {
|
||||||
$u=user_load_by_uid($r->users_uid);
|
$u=user_load_by_uid($r->users_uid);
|
||||||
$replacements=array(
|
$replacements=array(
|
||||||
@ -661,7 +664,9 @@ case "email_get_list":
|
|||||||
"LASTNAME"=>$u['lastname'],
|
"LASTNAME"=>$u['lastname'],
|
||||||
"NAME"=>$u['name'],
|
"NAME"=>$u['name'],
|
||||||
"EMAIL"=>$u['email'],
|
"EMAIL"=>$u['email'],
|
||||||
"ORGANIZATION"=>$u['sponsor']['organization']
|
"ORGANIZATION"=>$u['sponsor']['organization'],
|
||||||
|
"URLMAIN"=>$urlmain,
|
||||||
|
"URLLOGIN"=>$urllogin,
|
||||||
);
|
);
|
||||||
|
|
||||||
if($u['email']) {
|
if($u['email']) {
|
||||||
@ -781,6 +786,10 @@ case "email_get_list":
|
|||||||
$emailqueueid=mysql_insert_id();
|
$emailqueueid=mysql_insert_id();
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
|
|
||||||
|
$urlproto = $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
|
||||||
|
$urlmain = "$urlproto{$_SERVER['HTTP_HOST']}{$config['SFIABDIRECTORY']}";
|
||||||
|
$urllogin = "$urlmain/login.php";
|
||||||
|
|
||||||
while($r=mysql_fetch_object($recipq)) {
|
while($r=mysql_fetch_object($recipq)) {
|
||||||
if($r->uid)
|
if($r->uid)
|
||||||
$u=user_load_by_uid($r->uid);
|
$u=user_load_by_uid($r->uid);
|
||||||
@ -796,7 +805,9 @@ case "email_get_list":
|
|||||||
"LASTNAME"=>$r->lastname,
|
"LASTNAME"=>$r->lastname,
|
||||||
"NAME"=>$r->firstname." ".$r->lastname,
|
"NAME"=>$r->firstname." ".$r->lastname,
|
||||||
"EMAIL"=>$r->email,
|
"EMAIL"=>$r->email,
|
||||||
"ORGANIZATION"=>$r->organization
|
"ORGANIZATION"=>$r->organization,
|
||||||
|
"URLMAIN"=>$urlmain,
|
||||||
|
"URLLOGIN"=>$urllogin,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if($u) {
|
if($u) {
|
||||||
@ -807,7 +818,9 @@ case "email_get_list":
|
|||||||
"LASTNAME"=>$u['lastname'],
|
"LASTNAME"=>$u['lastname'],
|
||||||
"NAME"=>$u['name'],
|
"NAME"=>$u['name'],
|
||||||
"EMAIL"=>$u['email'],
|
"EMAIL"=>$u['email'],
|
||||||
"ORGANIZATION"=>$u['sponsor']['organization']
|
"ORGANIZATION"=>$u['sponsor']['organization'],
|
||||||
|
"URLMAIN"=>$urlmain,
|
||||||
|
"URLLOGIN"=>$urllogin,
|
||||||
);
|
);
|
||||||
|
|
||||||
$toname=$u['name'];
|
$toname=$u['name'];
|
||||||
|
@ -907,6 +907,19 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array())
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
/* Standard substitutions that are constant no matter who
|
||||||
|
* the $to is */
|
||||||
|
$urlproto = $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
|
||||||
|
$urlmain = "$urlproto{$_SERVER['HTTP_HOST']}{$config['SFIABDIRECTORY']}";
|
||||||
|
$urllogin = "$urlmain/login.php";
|
||||||
|
$stdsub = array("FAIRNAME"=>i18n($config['fairname']),
|
||||||
|
"URLMAIN"=>$urlmain,
|
||||||
|
"URLLOGIN"=>$urllogin,
|
||||||
|
);
|
||||||
|
/* Add standard subs to existing sub arrays */
|
||||||
|
$sub_subject = array_merge($sub_subject, $stdsub);
|
||||||
|
$sub_body = array_merge($sub_body, $stdsub);
|
||||||
|
|
||||||
//if our "to" doesnt look like a valid email, then forget about sending it.
|
//if our "to" doesnt look like a valid email, then forget about sending it.
|
||||||
if(!isEmailAddress($to))
|
if(!isEmailAddress($to))
|
||||||
return false;
|
return false;
|
||||||
|
@ -108,7 +108,7 @@
|
|||||||
|
|
||||||
if($r)
|
if($r)
|
||||||
{
|
{
|
||||||
email_send("register_participants_resend_regnum",$_SESSION['email'],array("FAIRNAME"=>i18n($config['fairname'])),array("REGNUM"=>$r->num,"FAIRNAME"=>i18n($config['fairname'])));
|
email_send("register_participants_resend_regnum",$_SESSION['email'],array(),array("REGNUM"=>$r->num));
|
||||||
send_header("Participant Registration");
|
send_header("Participant Registration");
|
||||||
echo notice(i18n("Your registration number has been resent to your email address <b>%1</b>",array($_SESSION['email']),array("email address")));
|
echo notice(i18n("Your registration number has been resent to your email address <b>%1</b>",array($_SESSION['email']),array("email address")));
|
||||||
}
|
}
|
||||||
@ -345,7 +345,7 @@
|
|||||||
$config['FAIRYEAR'].
|
$config['FAIRYEAR'].
|
||||||
")");
|
")");
|
||||||
|
|
||||||
email_send("new_participant",$_SESSION['email'],array("FAIRNAME"=>i18n($config['fairname'])),array("REGNUM"=>$regnum, "FAIRNAME"=>i18n($config['fairname']),"EMAIL"=>$_SESSION['email']));
|
email_send("new_participant",$_SESSION['email'],array(),array("REGNUM"=>$regnum,"EMAIL"=>$_SESSION['email']));
|
||||||
|
|
||||||
echo i18n("You have been identified as a new registrant. An email has been sent to <b>%1</b> which contains your new <b>registration number</b>. Please check your email to obtain your <b>registration number</b> and then enter it below:",array($_SESSION['email']),array("email address"));
|
echo i18n("You have been identified as a new registrant. An email has been sent to <b>%1</b> which contains your new <b>registration number</b>. Please check your email to obtain your <b>registration number</b> and then enter it below:",array($_SESSION['email']),array("email address"));
|
||||||
echo "<input type=\"hidden\" name=\"action\" value=\"new\">";
|
echo "<input type=\"hidden\" name=\"action\" value=\"new\">";
|
||||||
|
Loading…
Reference in New Issue
Block a user