• 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: I cannot overwrite $userEmail['fromname']

I cannot overwrite $userEmail['fromname'] 2 years 3 months ago #41772

Hi there,

I have a question on $userEmail.
Default we need to add a from name in the form (Form Properties > User Email).
However, via PHP Email script, it's possible to overwrite this with another value. I am able to do this with

$userEmail = $subject;
$userEmail = $text;

This works perfectly.
However when I want to overwrite the $userEmail, this value doesn't overwrite.
$fromName = "new name";
$userEmail = $fromName;

Is there a reason, or am I doing something wrong.
Thanks a lot for feedback,
Kind regards
The administrator has disabled public write access.

I cannot overwrite $userEmail['fromname'] 2 years 3 months ago #41779

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

I'm unsure how you're actually modifying this but the following is incorrect:
$userEmail = $fromName;

Try using this instead:
$userEmail['fromName'] = "New Name Here";

Of course also ensure that you're adding this in the according User Email designated scripting area (PHP Emails Scripts).

PS: note that some mailers might not allow using different a from email and name so overriding these may result in the email no longer sending.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

I cannot overwrite $userEmail['fromname'] 2 years 3 months ago #41805

Hi there,

thank you for quick reply.

This $fromName is just a variable - from a condition, and indeed is the new name. This chat shortens my text...
I have other variables in this condition that work (like the subject and the content)

if ($lang == "NL") { $fromName = "ABC"; $subject = "NL"; } else { $fromName = "DEF"; $subject = "FR"; };

$userEmail = $fromName; (so its $ userEmail = $fromName; without spaces)
$userEmail = $subject;
$userEmail =$content;

This scripting is added in Form Properties > PHP Email Scripts > Scripts called before the User Email is sent.
All other variables are working. only the $userEmail cannot be overwritten.
Last Edit: 2 years 3 months ago by djieply.mai.
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!