For the record I have asked this on
TXnewsletter support thread a while back with no success.
TXnewsletter email validation does not accept email such as
[email protected].
If there are no . _ - in their address = they can’t subscribe.
Around line 250 :
// TESTE VALIDITE EMAIL
unset($email_invalid[$i]);
$valid = false;
if ((preg_match(’`^[[:alnum:]]([-_.]?[[:alnum:]])*@[[:alnum:]]([-_.]?[[:alnum:]])*\.([a-z]{2,4})$`’,$data))){
//Uncomment to activate DNS check for email domains
//$domaine = substr(strstr($data, ’@’),1);
//if (checkdnsrr($domaine)){$valid= true;}
$valid = true;
}
I think it has to do with the part in red :
preg_match(’`^[[:alnum:]]
([-_.]?[[:alnum:]])*@[[:alnum:]]([-_.]?[[:alnum:]])
*\.([a-z]{2,4})$`’,$data)
But I can’t write regular expressions could somebody help out ?
Maybe adapt eForm validation scheme (see bellow) to TXnewsletter ?
case "email":
//stricter email validation
if (strlen($value)>0 &&!preg_match(
’/^(?:[a-z0-9_-]+?\.)*?[a-z0-9_-]+?@(?:[a-z0-9_-]+?\.)*?[a-z0-9_-]+?\.[a-z0-9]{2,5}$/i’, $value) ){
$vMsg[count($vMsg)]=$desc . $_lang["ef_invalid_email"];
$rClass[$name]=$invalidClass;
}
TXnewsletter is really great - since you can use it to automatically build newsletters from MODx documents, pretty handy with Ditto calls - it’s too bad an email validation scheme ruins a key part of it
Thanks !