The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Create User Programmatically - Email Not Sent
I'm attempting create a user programmatically for the purpose of integrating my shopping cart software to vBulletin. The problem I'm having is that my code creates a new user but doesn't send the email specified in the code. I suspect there is some combination of settings that I don't have quite right - can you help? I'm not finding much in the way of documentation on vbmail - is there a better way?
Code:
<?php define('THIS_SCRIPT', 'register'); define('VB_AREA', 'External'); define('SKIP_SESSIONCREATE', 1); define('SKIP_USERINFO', 1); define('CWD', '../forum'); require_once(CWD . '/includes/init.php'); // init user datamanager class $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); // check for matching email addresses if ($vbulletin->GPC['email'] != $vbulletin->GPC['emailconfirm']) { $userdata->error('emailmismatch'); } // set email, username & usergroup $userdata->set('username', 'bjones'); $userdata->set('email', 'bjones@gmail.com'); $userdata->set('password', 'verysecret'); $userdata->set('usergroupid', 2); $userdata->pre_save(); // check for errors if (!empty($userdata->errors)) { $errorlist = ''; foreach ($userdata->errors AS $index => $error) { $errorlist .= "<li>$error</li>"; } // ... additional code; $errorlist is outputted to the user $username = htmlspecialchars_uni($vbulletin->GPC['username']); $email = htmlspecialchars_uni($vbulletin->GPC['email']); $password = htmlspecialchars_uni($vbulletin->GPC['password']); $show['errors'] = true; } else { $show['errors'] = false; // save the data $vbulletin->userinfo['userid'] = $userid = $userdata->save(); // send new user email require_once(DIR . '/includes/functions.php'); $userinfo = fetch_userinfo($userid); $username = $vbulletin->GPC['username']; $email = $vbulletin->GPC['email']; eval(fetch_email_phrases('welcomemail')); vbmail($email, $username, $subject, $message); } ?> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|