The following warnings occurred: | ||||||||||||||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
e-mail not verifying - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27) +--- Thread: e-mail not verifying (/showthread.php?tid=1502) |
e-mail not verifying - LBC - 05-27-2019 Hi, The verify e-mail link is being built up as follows: https://www.mywebsite.comusers/verify.php?email=my@email.com&vericode=ooD1S5de0jTFdvF 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? RE: e-mail not verifying - mudmin - 05-29-2019 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); RE: e-mail not verifying - LBC - 05-29-2019 wow, such a simple solution to that e-mail verification issue. Im all embarressed now that I didnt see that myself 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? RE: e-mail not verifying - mudmin - 05-29-2019 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. RE: e-mail not verifying - LBC - 05-29-2019 something like this? https://pastebin.com/dHVsYiWm RE: e-mail not verifying - mudmin - 05-29-2019 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); ?> RE: e-mail not verifying - LBC - 05-29-2019 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 ? RE: e-mail not verifying - mudmin - 05-29-2019 There must be a php error in there somewhere. Do you have error reporting turned on? RE: e-mail not verifying - LBC - 05-29-2019 no, it just displays my usersc/join.php completely empty (but with the background colour in tact). RE: e-mail not verifying - mudmin - 05-29-2019 But do you have error reporting turned on in php.ini? |