I need to add a custom shortcode to the welcome email of my website.
I\'m not expert; what I need is in plugabble.php file?
I tried a lot of plugins for edit email template but nothing seems work.
Is there anyone that can help me please?
Thanks in advance!
Ps. This is the one time link script that I have modified:
function one_time_link(){
/* Generate a unique token: */
$token = md5(uniqid(rand(),1));
$file = "/tmp/urls.txt";
if( !($fd = fopen($file,"a")) )
die("Could not open $file!");
if( !(flock($fd,LOCK_EX)) )
die("Could not aquire exclusive lock on $file!");
if( !(fwrite($fd,$token."\\n")) )
die("Could not write to $file!");
if( !(flock($fd,LOCK_UN)) )
die("Could not release lock on $file!");
if( !(fclose($fd)) )
die("Could not close file pointer for $file!");
/* Report the one-time URL to the user: */
$linkResult = "Your One Time Link\\n";
}
I\'ve tried this:
class LinkGenerator {
public function one_time_link(){
/* Generate a unique token: */
$token = md5(uniqid(rand(),1));
/* This file is used for storing tokens. One token per line. */
$file = "/tmp/urls.txt";
if( !($fd = fopen($file,"a")) )
die("Could not open $file!");
if( !(flock($fd,LOCK_EX)) )
die("Could not aquire exclusive lock on $file!");
if( !(fwrite($fd,$token."\\n")) )
die("Could not write to $file!");
if( !(flock($fd,LOCK_UN)) )
die("Could not release lock on $file!");
if( !(fclose($fd)) )
die("Could not close file pointer for $file!");
/* Report the one-time URL to the user: */
$linkResult = "Your Special Link\\n";
echo "$linkResult";
}
}
add_filter( \'wpbe_tags\', \'wpse_225078_wpbd_tags\' );
function wpse_225078_wpbd_tags( $tags ) {
$genLink = \'LinkGenerator\';
$a = new $genLink();
$tags[\'one_time_link\'] = $a->one_time_link();
return $tags;
}
It seems correct for me but it doesn\'t work...