Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Send Validation-Mail manually?

Quote Reply
Send Validation-Mail manually?
Hi,

i found this passage in Users.inc.php:

# --------------------------------------------------------
# Sends a validation email to the user.
#
global $IN, $CFG;
$to = $IN['Email'];
$from = $CFG['db_admin_email'];
$subject = language('USER_VALEMAILSUB');
$message = print_page('email-validate.txt', $user, array('return_as_string' => 1));
mailto($to, $from, $subject, $message);
}

My question now:
Is it possible to send a user manually a validation-email with all the necessary fields via global?
e.g. <%send_validation_mail_now%>

Thanks in advance!

Coyu
Quote Reply
Re: [Coyu] Send Validation-Mail manually? In reply to
This is in PHP I'm assuming? If so, the PHP frontend of LinksSQL doesn't actually support 'globals' as such. You would need pure PHP code;

i.e

Code:
<?

global $IN, $CFG;
$to = $IN['Email'];
$from = $CFG['db_admin_email'];
$subject = language('USER_VALEMAILSUB');
$message = print_page('email-validate.txt', $user, array('return_as_string' => 1));
mailto($to, $from, $subject, $message);

?>

This would need to go into the template itself, so that it run at compilation time. I'm not sure if the above will work though, as my PHP knowledge (generally, and in LinksSQL) is a little rusty, as I havn't had to program any for over 4 months Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Coyu] Send Validation-Mail manually? In reply to
ok! but i need it in perl! no php!

Is there no possibility to send an email via global?

Coyu
Quote Reply
Re: [Coyu] Send Validation-Mail manually? In reply to
Quote:
Is there no possibility to send an email via global?

If you have the email option turned on in Setup > Email Options (can be User Options), then it should send out validation emails automatically.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Send Validation-Mail manually? In reply to
yepp, i know :-)
But i need to manage it manually!

Is that possible? Something like:

GLOBAL:
# globalname sendmail
# This global sends an email to the logged in user
# template = email-text.txt

TEMPLATE:
# email-text.txt (as template)
# hello <%Name%>
# Your email is <%email%>
# Your Validation code is <%Validation%>
# cuu

START SENDING WITH:
<%sendmail%>