2
0
forked from Wavyzz/dolibarr

Start to introduce MAIN_EMAIL_ADD_TRACK_ID option to test inclusion of

tracking id into email.
This commit is contained in:
Laurent Destailleur
2015-03-03 18:33:53 +01:00
parent e667c3e916
commit fddbca50b1
3 changed files with 28 additions and 8 deletions

View File

@@ -371,6 +371,21 @@ function dol_print_object_info($object)
}
}
/**
* Return an email formatted to include a tracking id
* For example myemail@mydomain.com becom myemail+trackingid@mydomain.com
*
* @param string $email Email address (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @param string $trackingid Tracking id (Ex: thi123 for thirdparty with id 123)
* @return boolean True if domain email is OK, False if KO
*/
function dolAddEmailTrackId($email, $trackingid)
{
$tmp=explode('@',$email);
return $tmp[0].'+'.$trackingid.'@'.(isset($tmp[1])?$tmp[1]:'');
}
/**
* Return true if email has a domain name that can't be resolved
*