Hi MODX people,
I wrote a small snippet for creating kind of secure email links. I followed
this guide and here it is. It does not verify anything.
create a new snipptet called
emailLink
$email = $scriptProperties['email'];
if (empty($email)) {
$modx->log(modX::LOG_LEVEL_DEBUG,'[emailLink] Empty email adress passed, aborting.');
return '';
}
else {
// Set placeholders:
$modx->setPlaceholder('email', strrev($email));
return $modx->getChunk('emailLink');
}
the chunk is also called
emailLink
<span style="unicode-bidi:bidi-override;direction: rtl;"><a onclick="this.href='mailto:'+ this.innerHTML.split('').reverse().join('')" href="#">[[+email]]</a></span>
call it like this:
Hope you find it useful as I do
Cheers,
Guido