[insert_php] $first_name = ucfirst(strtolower($_POST[‘first_name’]));
$last_name = ucfirst(strtolower($_POST[‘last_name’]));
$email = $_POST[’email’];
$username = $email;
$password = trim($_POST[‘password’]);
$address = $_POST[‘address’];
$city = $_POST[‘city’];
$postal = $_POST[‘postal’];
$receivepackage = $_POST[‘receivepackage’];
$province = $_POST[‘province’];
$union_name = $_POST[‘union_name’];
$union_local = $_POST[‘union_local’];

global $wpdb;

$wpdb->insert(
‘union_plus_registrants’,
array(
‘first_name’ => $first_name,
‘last_name’ => $last_name,
‘username’ => $username,
’email’ => $email,
‘password’ => $password,
‘address’ => $address,
‘city’ => $city,
‘postal’ => $postal,
‘receivepackage’ => $receivepackage,
‘province’ => $province,
‘date_registered’ => date(‘Y-m-d’),
‘union_name’ => $union_name,
‘union_local’ => $union_local
)
);

//Set up mail format
$headers = “From: postmaster@ufcw102.ca” . “\r\n”;
$headers .= ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;

//Send mail to Admin
$to = “info@unionplus.ca”;
$subject = “New Union Plus Registration – Union Strategies Inc”;
$body = ‘




‘;
$body .= “

There is a new member who would like to register.

“;
$body .= “

First Name: ” . $first_name . “
“;
$body .= “Last Name: ” . $last_name . “
“;
$body .= “Username: ” . $username . “
“;
$body .= “Email: ” . $email . “
“;
$body .= “Password: ” . $password . “
“;
if ($receivepackage == 1)
{
$body .= “This member has opted-in to receive the free prepaid Visa Package.
“;
$body .= “Mailing Address: ” . $address . ” ” . $city . ” ” . $province . ” ” . $postal . “
“;
}
else
{
$body .= “This member has not opted-in to receive the free prepaid Visa Package.
“;
}

$body .= “Date Registered: ” . date(‘Y-m-d’) . “
“;
$body .= “Union Name: ” . $union_name . “
“;
$body .= “Union Local: ” . $union_local . “

“;

//mail( $to, $subject, $body, $headers );

//Send mail to member
$to = $email;
$subject = “Welcome to Union Plus”;
$body = ‘





unionplus

You have successfully registered!

‘;
$body .= $first_name . “, thank you for registering with Union Plus!

“;
$body .= “Your credentials are the following:

“;
$body .= “Username: ” . $username . “
“;
$body .= “Email: ” . $email . “
“;
$body .= “Password: ” . $password . “

“;
$body .= ‘Please save or print this information for your own records.
Please allow up to 24 to 48 hours for your account to become active. You may log in here.

‘;
//mail( $to, $subject, $body, $headers );

[/insert_php]

unionplus

Thank you for registering with Union Plus!

In a few moments you will receive a confirmation in your email ([insert_php]echo $email;[/insert_php]). Please allow 24 to 48 hours for your Union Plus account to become active.

Click here to return to the home page.