mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Start to introduce MAIN_EMAIL_ADD_TRACK_ID option to test inclusion of
tracking id into email.
This commit is contained in:
@@ -37,9 +37,9 @@
|
||||
class CMailFile
|
||||
{
|
||||
var $subject; // Topic: Subject of email
|
||||
var $addr_from; // From: Label of sender (name but can contains an email inside <>)
|
||||
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@mydomain.com>' or 'John Doe <myemail@mydomain.com>' or '<myemail+trackingid@mydomain.com>')
|
||||
// Sender: Who send the email ("Sender" has sent emails on behalf of "From").
|
||||
// Use it with an email from a sending host from is a SPF protected domain and sending host is not this domain.
|
||||
// Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, use for Sender an email of the protected domain.
|
||||
// Return-Path: Email where to send bounds.
|
||||
var $errors_to; // Errors-To: Email where to send errors.
|
||||
var $addr_to;
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -2129,6 +2129,11 @@ else
|
||||
$formmail->fromid = $user->id;
|
||||
$formmail->fromname = $user->getFullName($langs);
|
||||
$formmail->frommail = $user->email;
|
||||
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID))
|
||||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'thi'.$object->id);
|
||||
}
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withtopic=1;
|
||||
$liste=array();
|
||||
|
||||
Reference in New Issue
Block a user