Jump to content

regsent template mod:


Rob

Recommended Posts

Hi Rob,

I use the following lines in my email_registrationaccepted.tpl but I think it should work just as well in any other email such as registration_sentconfirmation.tpl.

Pilot Name: <?php echo $pilot->firstname.' '.$pilot->lastname ?><br/>
Pilot ID: <?php echo PilotData::GetPilotCode($pilot->code,$pilot->pilotid)?><br/>
Login Email Address: <?php echo $pilot->email?><br/>
Login Password: The password you chose during signup<br/> 

I'd advise against the sending of passwords in emails for obvious reasons ;)

Hope that helps.

Link to comment
Share on other sites

Ah, but wouldn't the pilot need to be signed in for them to see the details?

On some sites when you submit your registration on the next page it comes up with the "your application has been sent blah blah blah, below are the account details you signed up with:"

That is basically what i want to put on the reg sent tpl so the user can see the info they used when registering without being signed into the site.

Link to comment
Share on other sites

OK, I understand what you're trying to do now.

I just altered the email which is sent once a pilot has been accepted to include all the account details (so they don't need to be logged into the site), but I see you're wanting to display them on the page following registration.

Hmmm, I'm sure this should be possible by pulling the data in a similar manner.

I'll have a play with the template and see what I can come up with.

Link to comment
Share on other sites

Thanks, sorry for not making it a bit more clearer :P

Thanks a lot anyways, i'll look into how to do it a bit more clearly tomorrow, but i'd guess to do what i want i'd have to query the latest or relevant mysql data inserts that corresponds with the pilot sign up. Which i have no idea on how to code that sort of thing  :P

Cheers again,

regards,

Rob

Link to comment
Share on other sites

Managed to get something up and working, although it's maybe not the pretiest code and possibly a case of using a sledgehammer to crack a walnut, but it works :)

<h3>Confirmation Sent</h3>

<p>Thanks for registering with <?php echo SITE_NAME; ?>.</p>

<?php
$newpilots = PilotData::GetLatestPilots(1);
foreach($newpilots as $newpilot)
{
?>
Your account will be created using the following details:<br/>
Pilot Name: <?php echo $newpilot->firstname.' '.$newpilot->lastname ?><br/>
Login Email Address: <?php echo $newpilot->email?><br/>
Login Password: The password you chose during signup<br/> 
<?php
}
?>
<p>Your application will now be processed, so please check your email for further updates.</p>

As I say, there may be a better way to do it, but it's 01:20 here right now, so I'm a bit brain-dead, lol. Going to grab some kip now ;)

Link to comment
Share on other sites

  • Administrators

In the registration_sentconfirmation.tpl, you can use the $_POST variables directly:

<?php
$_POST['firstname'];
$_POST['lastname'];
$_POST['email'];
$_POST['code'];
$_POST['location'];
$_POST['hub'];
$_POST['password1'];

Hopefully that helps

Link to comment
Share on other sites

Hi All

please help  ;D

here is my code:

Dear <?php echo $firstname .' '. $lastname; ?>,<br /><br />

Your account have been made at <?php echo SITE_NAME?>, but your account has not yet been activated. You will receive an email when your registration has been activated by someone on our staff.<br /><br />

Pilot Name: <?php echo Vars::POST('firstname'); ?> <?php echo Vars::POST('lastname'); ?><br/>
Email Address: <?php echo Vars::POST('email'); ?><br/>
Login Pilot ID: <?php echo $code; ?><br/>
Login Pilot ID: <?php echo PilotData::GetPilotCode($pilot->code,$pilot->pilotid)?><br/>
Login Password: As specified during registration<br/> 
<br /><br />

Thanks!<br /><br />
<?php echo SITE_NAME?> Staff

As you can see I have tried getting teh pilot code in two different ways and both give me undesired results.

The for teh login pilot ID I either get teh company code (OCC) or I get three zero's.

I set my config to only use three zero's instead of teh default 4.

Any help would be appreciated

Cheers

Link to comment
Share on other sites

Hi Selwyn,

It's prolly easier to use the $POST variables directly, like this:

Pilot Name: <?php echo $_POST['firstname'],$_POST['lastname'];?><br/>
Email Address: <?php echo $_POST['email'];?><br/>

Follow the same pattern for whatever variables you need to display.

If you want the pilotid, then this will have to be pulled from the database using the API. Something like this should work.

<?php
$newpilots = PilotData::GetLatestPilots(1);
foreach($newpilots as $newpilot)
  {
  echo 'Pilot ID: ' . $_POST['code'],$newpilot->pilotid;
  }
?>

Nabeel may know a neater way to grab the pilot id though :)

Hope that helps.

Link to comment
Share on other sites

  • Administrators

You'll have to do what Nige said, since the pilot variable hasn't been assigned to the template. Using Vars::Post() is probably also cleaner, since it will filter, though I think you can use Vars::$post->code etc. But no difference :)

Link to comment
Share on other sites

Wow guys thanks very very much.

It become painfully obvious that I still dont readyy understand this code at all  ??? ;D

Nige Thanks that work like a charm except that it remove the zero's i.e the result would be OCC2, etc

I have used you code as is and hacked it slightly to give me the zero's that I am looking for. Nige Nabeel, would you mind showing me if tehre is a simpler and cleaner way to do it.

<?php
$newpilots = PilotData::GetLatestPilots(1);
foreach($newpilots as $newpilot)
  {
  echo 'Pilot ID: ' . $_POST['code'],$newpilot->pilotid;
  
?>

Dear <?php echo $firstname .' '. $lastname; ?>,<br /><br />

Your account have been made at <?php echo SITE_NAME?>, but your account has not yet been activated. You will receive an email when your registration has been activated by someone on our staff.<br /><br />

Pilot Name: <?php echo Vars::POST('firstname'); ?> <?php echo Vars::POST('lastname'); ?><br/>
Email Address: <?php echo Vars::POST('email'); ?><br/>
Login Pilot ID: <?php echo $_POST['code'],PilotData::GetPilotCode($pilot->code,$pilot->pilotid),$newpilot->pilotid; ?><br />
Login Pilot ID: <?php echo PilotData::GetPilotCode($pilot->code,$pilot->pilotid)?><br/>
Selected Hub: <?php echo Vars::POST('hub'); ?><br/> 
<br /><br />

Thanks!<br /><br />
<?php echo SITE_NAME?> Staff

<?php
}
?>

Again I apologise for the repeated mistackes and lack of understanding. Ill get better I promise  ;D

Cheers

Link to comment
Share on other sites

  • Administrators

No prob! At least you are trying.

You're getting blanks because you're using $pilot instead of $newpilot in some places

eg, you just need:

Login Pilot ID: <?php echo PilotData::GetPilotCode($newpilot->code,$newpilot->pilotid)?><br/>

Link to comment
Share on other sites

Hi Nabeel

Great I will definateloy have a look at it.

All the advice has paid off and I have just finished uploading the result.

Complete custom skin. with phpBB 2 forum intergration as well as custom confirmation email  ;) all thatnks to you and nege.

I am pretty happy with it. Now I just need to add content  ::)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...