Author Topic: User Name in email templates  (Read 1252 times)

Offline n.richard

  • Sr. Member
  • ****
  • Posts: 70
    • View Profile
User Name in email templates
« on: 16/February/2010, 09:25:35 AM »
Hi,

I'd like to include the Joomla User Name of the Contact in email templates (especially Invoice mail), as NBill 1.2 did (when email templates did not exist!).

I found out that $document_id variable holds the Invoice ID but my programming skill are far insufficient to go any further!

Thanks for your help.

PS: including the user password too would have been great, but I guess this is not possible... Tell me if I'm wrong... Or if there is any way to send the user name and password automatically when a Joomla User is created by NBill.

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: User Name in email templates
« Reply #1 on: 16/February/2010, 11:09:33 AM »
In most cases the username will be available in $document->username. Check for the existence of the property before using it, or prefix with an @ symbol in case it is not defined (only likely to happen when emailing directly from the invoice list using the envelop icon, but I will amend it to include the username even in that case for the next release).

The only time the user password is available is when an order form is submitted containing a password field. It is not included on order confirmation emails any more as I had some complaints about the security implications of that, however, you can login to the admin side and check the order record to see the password that was entered. Once a user record has been created, the password is hashed so cannot be decrypted.

Offline n.richard

  • Sr. Member
  • ****
  • Posts: 70
    • View Profile
Re: User Name in email templates
« Reply #2 on: 17/February/2010, 10:47:21 AM »
Works fine, including for mails sent from the Invoice list in backend (and without @).

Thanks! (If ever you have some time to write a documentation on which variables can be used in email templates ;-)

Offline joomla.travel

  • Full Member
  • ***
  • Posts: 23
    • View Profile
Re: User Name in email templates
« Reply #3 on: 22/December/2011, 07:28:06 AM »
Hi only the username is shown in the client invoice e-mail, when you create a new user in nbill back admin !!, how are the client going to login? if they dont have a password, I need the password to be send with the username to the new client, how do I do that??

Thanks

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: User Name in email templates
« Reply #4 on: 22/December/2011, 08:09:13 AM »
nBill is designed to allow the user to choose their own password when they submit an order form. If you as an administrator are creating a new client in the back end manually, it is assumed that you are in communication with the client separately from nBill, so you can just tell them their login details. If you would like to request a new feature where the login details, including the password can optionally be automatically e-mailed to the client (note there may be a security risk involved there), please post a topic on the suggestions board, thanks.

Offline joomla.travel

  • Full Member
  • ***
  • Posts: 23
    • View Profile
Re: User Name in email templates
« Reply #5 on: 22/December/2011, 08:22:19 AM »
Thanks, done

Offline richo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: User Name in email templates
« Reply #6 on: 20/June/2012, 06:54:52 PM »
Hello,
what is php code for introduce user name in email template ?

Thanks

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: User Name in email templates
« Reply #7 on: 20/June/2012, 07:19:06 PM »
echo $document->username;