• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Is there any way to send email to reg user?

Is there any way to send email to reg user? 16 years 3 months ago #1649

  • Tray
  • Tray's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hello,

I have RSForme behind the user login, meaning you have to be a registered user on the site to access the form. Joomla is installed on an intrAnet...meaning all users are authenticated and real with a common email address ( This e-mail address is being protected from spambots. You need JavaScript enabled to view it ).

Is there any way for RSForme to access the registered users database to see who the logged in user is, then use their email address to send a confirmation email when they submit a form?

For example, the form I have is for daily hours submissions. At the end of the day, each staff member logs in and submits their hours. Right now, RSForme stores the data in its table. I have the form setup to email myself.

It'd be ideal to have the form email myself and the employee who submitted the hours (without forcing the employee to enter their email address as a field).

Any ideas?

Thank you.
The administrator has disabled public write access.

Re:Is there any way to send email to reg user? 16 years 3 months ago #1665

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
Hi Tray,

that is possible. Please create a hidden field. name it email.(field id=email). Then, in the Email form data to: type {email}. This means that RSform! will send emails to whatever value is in the email field. And now, to populate this field, in the Scripts called on form process, type this code:
if(isset($_POST['form']['email'])){
//which means that the script is triggered only on form submission
global $my;
$_POST['form']['email'] = $my->email;
}
Let me know.
The administrator has disabled public write access.

Re:Is there any way to send email to reg user? 16 years 3 months ago #1703

  • Tray
  • Tray's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Thank you! That worked extremely well. Can I assume then that to do the same with the Username from the Joomla login, I substitute \"email\" with \"Username\" ?
The administrator has disabled public write access.

Re:Is there any way to send email to reg user? 16 years 3 months ago #1716

  • Tray
  • Tray's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Ha! I found the info in the \"Scripts\" forum and it works great.
The administrator has disabled public write access.

Re:Is there any way to send email to reg user? 12 years 11 months ago #13733

This is a couple years old but I need this functionality. I tried modifying the code to this for J1.6 but no dice:

if($_POST){
if(!$user){
$user =& JFactory::getUser();
}

$_POST = $user->email;

}
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!