• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
e-mail not verifying
#1
Hi,

The verify e-mail link is being built up as follows:

https://www.mywebsite.comusers/verify.ph...5de0jTFdvF

After the domain extension there is a / missing.
This is because it says the following in the _email_template_verify_new.php ?: 

<a href="<?=$results->verify_url?>users/verify.php?new=1&email=<?=$email;?>&vericode=<?=$vericode;?>" class="nounderline"><?=lang("EML_VER")?></a>

I have changed this and placed the copy of that file in usersc/includes/admin but it is not used (probably because its does not have a corresponding view from admin.php). So how can I get around this without altering the original file in users?



Also, would it be somehow possible to receive an e-mail (with their details) whenever someone registers?
  Reply
#2
Ok. So on the first thing, the / is missing because it's not in your site url when you go to settings->email settings in the dashboard. This isn't your fault at all because the one that's in there as a demo doesn't have a / on it, but the tooltip shows it. Let me do a bug report for that.

As far as the email when someone registers, right now, you would have to do it in the usersc/scripts/during_user_creation.php file

If you go into users/views you will see a bunch of _email templates in there. You can copy one for your template

Then you would just do
Params is whatever variables you might want access to in the email. You could just do an empty array if you don't want to customize the email on every join.
$params = array(
'username' => $userdetails->username,
'sitename' => $settings->site_name,
'fname' => $userdetails->fname,
'email' => rawurlencode($userdetails->email),
'vericode' => $userdetails->vericode,
'reset_vericode_expiry' => $settings->reset_vericode_expiry
);
$to = rawurlencode("you@you.com);
$subject = 'Password Reset';
$body = email_body('_email_adminPwReset.php',$params);
email($to,$subject,$body);
  Reply
#3
wow, such a simple solution to that e-mail verification issue. Im all embarressed now that I didnt see that myself Blush 

About your answer to my other question of me receiving an e-mail whenever someone registers, I don't really understand what to do with that information.
I just opened up _email_template_verify_new.php (from the users/views) and I assume I need to paste that piece of coding you provided in there somewhere?
  Reply
#4
So if you copy _email_template_verify_new.php to _email_newuser.php
Then you can edit _email_newuser.php to be pretty much anything. It can be as simple as, "Hey. You got a new user"

If it's that, then you can basically turn that whole $params thing up there into $params = []; and I'm guessing my example will pretty much work.

If you want to do things like put the username in the email then you will have to get a little fancier. Although, I THINK that array that I pasted will work. So you can just use those variables inside your email.
  Reply
#5
something like this?

https://pastebin.com/dHVsYiWm
  Reply
#6
Not exactly. So in your users/views/_email_newuser.php you have the whole top part right

So after </head> and before </body>, you would put something like
<p>Hey, you got a new user at <?=$sitename?>.</p>

Then cut all that php out at the bottom.
All of that would go inside usersc/scripts/during_user_creation.php
and in that situation it would be

<?php

$params = array(
'sitename' => $settings->site_name,
);
$to = rawurlencode("you@you.com");
$subject = 'You got a new user!';
$body = email_body('_email_newuser.php',$params);
email($to,$subject,$body);

?>
  Reply
#7
hmm..that results in an empty usersc/join.php and no e-mail.

Also, this means creating a new file in the users folder...which will be deleted after an update.
I thought all new custom stuff should go in the usersc ?
  Reply
#8
There must be a php error in there somewhere. Do you have error reporting turned on?
  Reply
#9
no, it just displays my usersc/join.php completely empty (but with the background colour in tact).
  Reply
#10
But do you have error reporting turned on in php.ini?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)