ok, I understand the mail() function after it was explained to me and I read upon the tutorials, but how do you send 2 notifications e.g. 1 to admin and the other to a new user?
What I mean is something like:
For alerting admin of a new user:
if($settings['notify'] == 1) {
$message="Hello $settings[admin_name]
You have a new affiliate waiting to be approved. To approve or deny the affiliation, please log into your Affinity Affiliation System at: $settings[site_url]
Affiliate Details:
Name: $username
E-mail: $email
URL: $siteurl
Title: $sitetitle
Description: $des
Regards,
Affinity.
";
$headers = "From: $settings[admin_name] <$settings[admin_email]>\n";
$headers .= "Reply-To: $settings[admin_name] <$settings[admin_email]>\n";
mail($settings['admin_email'],'New Affiliate Pending Approval',$message,$headers);
For sending a new user their username and password:
if($settings['notify_pw'] == 1) {
$message="Hello $username
This email was sent to you because you signed up to be an affiliate with $settings[site_name]. Your chosen username and password are provided below, please do not lose this email as you will need both your name and password to update your information at: $settings[site_url]
Affiliate Details:
Name: $username
Password: $pw
Regards,
$settings[admin_name].
";
$headers = "From: $settings[admin_name] <$settings[admin_email]>\n";
$headers .= "Reply-To: $settings[admin_name] <$settings[admin_email]>\n";
mail($settings['admin_email'],'$settings[site_name] Affiliation',$message,$headers);
I'd like these 2 notification coding to be put into my coding upon insert of a new user into my db, but I'm not sure how to do it.
I tried the elseif if and else arguments, but it ends up only sending an email to admin, ignoring the code asking to send an email to the new user too.
Any ideas?