The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Customise Welcome Email - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Customise Welcome Email (/showthread.php?tid=483)



Customise Welcome Email - Aaron - 03-02-2017

Hey guys!

To preface - I'm a total php noob... Mainly a front end dev here who fiddles with php only every now and then. I've been using Usercake, and now Userspice, to build a secure container around a product/investment website our company runs so we can hand out logins for certain people we want to show the product to. So far I'm really enjoying the learning process.. It's a steep curve, but so far the software and the documentation here has been really good Smile

Now, I'm trying to extend a couple of things in the framework. So far, I've fiddled with the registration system so now when a user registers, it sends the admin an email asking to approve that member. Once the member is approved by the admin, they get an email notifying them that they can now log in.

However, I'm trying to get the initial approval notification email to display more information. Basically, I want the email that my admin recieves to show all the fields about that user: first/last name, username, company name, phone number etc... I can see that $fname; is queried and appended to the email easily enough, but the block of php in the _email_template_activated.php file (below) doesn't seem to be enough to fetch $lname;, $company, and the other custom fields I've added like phone and so forth...
Can someone please point out what I need to query to show these other values? I've been trying things like $results = $query->all(); which doesn't seem to work..

Thanks guys!

<pre>
Code:
<?php
$db = DB::getInstance();
$query = $db->query("SELECT * FROM email");
$results = $query->first();
?>
</pre>



Customise Welcome Email - mudmin - 03-02-2017

haha. Yeah. There's some trickery going on there. So the _email_template_verify is being pulled in on the join form.

On the join form, you'll notice that on line 68, we're getting $fname from Input::get('fname')

Basically what that's doing is taking their form input from the join form, sanitizing it, and giving it that variable. Because the verify email thing is required in on line 171 of the join form, you basically have access to any variables that were declared up to that point. Basically if you want access to anything they filled out on the join form, just do

$variable = Input::get('the name of the input you're grabbing');


If you need help working out any of your activation logic, I'd be happy to help.





Customise Welcome Email - Aaron - 03-02-2017

Ah nice, that works beautifully! Thanks for the rapid response man...

I'll probably be hitting you up a fair bit with various things I'm fiddling with, though problems that I solve I'll be happy to share with you if you wanted to extend userspice itself with if it helps with the framework for v5, etc.

What I've done so far isn't particularly elegant I don't feel, but hey... It works Tongue


Customise Welcome Email - mudmin - 03-02-2017

Sounds great! I'm all about just getting things to work. haha