Sending Username & Password on Joomla Registration?

Chacapamac 10 Jun, 2011
I like to send a small welcome message after a Joomla Registration form to the newly registered with his username and password (for him to keep).

If The message is adress to is own name, that will be cool.

I}m looking at Email[GH] right now

Can this be language sensitive (French / English)...?
GreyHead 11 Jun, 2011
Hi Chacapamac,

You can build a language sensitive email template with a little PHP.
<?php
$lang = JFactory::getLanguage();
switch ( $lang->getTag() ) {
  case 'fr-FR':
  default:
?>
// insert French language template here
<?php 
  break;
  case 'en-GB':
?>
// insert English language template here
<?php 
  break;
}
?>


Bob
Chacapamac 11 Jun, 2011
Thanks!
• Is this base on the browser or the originating site language (by Joomfish) ?

• Can you send the Username/Password that was input into the form?
Like that, they can keep that email as a reminder....
Chacapamac 14 Jun, 2011
This is what I try, so far:

1— I add the Action Email[GH]
[attachment=0]Picture.jpg[/attachment]

2 — Email[GH] Settings
General —>
• Enabled —> Yes
• Action label —> sendmail
• Send as HTML
• Attachments fields name —> empty field
• IP —> No

Template:
<?php
$lang = JFactory::getLanguage();
switch ( $lang->getTag() ) {
  case 'fr-FR':
  default:
?>
// insert French language template here

<p align="center"></p>
<p align="center"><font size="4" color="#cc0000"><b>Merci de votre inscription gratuite au portail et journal du Hockey organisé au Québec.<br>
		</b></font></p>
<p align="center"><a href="http://www.editionzoneshockey.com"><font size="4"><b>Édition Zones Hockey<br>
			</b></font></a></p>
<p align="center"><b>Vous pouvez garder ce courriel comme référence<br>
	</b></p>
<p align="center"></p>
<p align="center"> ——————— VOS IDENTIFIANTS  ——————— </p>
<p align="center"><b>Votre nom d’usager :</b> <?php echo $_POST['username'] ?></p>
<p align="center"> <b>Votre mot de passe :</b> <?php echo $_POST['password'] ?></p>
<p align="center">  </p>
<p align="center">Vous avez maintenant un accès permanent et privilégié au <b>Journal électronique EZH</b>,</p>
<p align="center">aux <b>outils du site EZH</b> et pouvez même gagner des prix et beaucoup plus.</p>
<p align="center"></p>

<?php 
  break;
  case 'en-GB':
?>
// insert English language template here

<p align="center"></p>
<p align="center"><font size="4" color="#cc0000"><b>Thank You for your Free Subscription to the Organize Hockey Portal in Quebec and the Online EZH Journal.<br>
		</b></font></p>
<p align="center"><a href="http://www.editionzoneshockey.com"><font size="4"><b>Edition Zones Hockey<br>
			</b></font></a></p>
<p align="center"><b>You can keep this email as reference<br>
	</b></p>
<p align="center"></p>
<p align="center">——————— YOUR LOGIN  INFORMATION ———————</p>
<p align="center"><b>Username:</b>  <?php echo $_POST['username'] ?></p>
<p align="center"><b>Password:</b> <?php echo $_POST['password'] ?></p>
<p align="center">  </p>
<p align="center">You now have a privileged access to the<b> EZH Online Journal,</b></p>
<p align="center"><b>all tools from EZH website</b> and eligible to win special prices and promotions.</p>
<p align="center"></p>

<?php 
  break;
}
?>


NOTE: Remark the
<?php echo $_POST['username'] ?> and <?php echo $_POST['password'] ?>
insert in the template to dynamically attach those field to the email

Static
TO —> email to the site administration
Subject, From, From email fill up...

Dynamic

Dynamic to —> email (this is the name of the form “email’ input

Result

Email sent to the correct address but with an empty body?????
GreyHead 14 Jun, 2011
Hi Chacapamac,

That all looks OK.

Test with some very simple text in the template then add back the text you have have here step by step until you discover what causes the error.

First add just'XXX'

Then try
XXX
<?php
$lang = JFactory::getLanguage();
echo $lang
?>
XXX

Then try
XXX
<?php
$lang = JFactory::getLanguage();
echo $lang
switch ( $lang->getTag() ) {
  case 'fr-FR':
  default:
    echo 'XXX fr-FR XXX'; 
  break;
}
?>
XXX

and so on

Bob
Chacapamac 14 Jun, 2011
I try


XXX
<?php
$lang = JFactory::getLanguage();
echo $lang
?>
XXX


I get only XXX not in a email but in the lightbox? (where my joomla article was showing up before?
This topic is locked and no more replies can be posted.