For some reason the Javascript to "Post Reply" on the original forum post of this message doesn't work, so I've started a new one. This is what was said so far:
Hi everyone,
Is there a way to populate the fields of "Your Name" and "Your Email" with the login nickname and the associated email address when the "invite a friend" window opens, as this function only seems to work if these values correspond with the logged in profile.
Many people will not think to use their login name but would use their full name and possibly a different email address.
If these values don't correspond a "send email failed" message appears.
Can something be changed in the tellfriend.php to make this happen?
Thanks,
Wizard247
_________________________________________________________________
This was replied to by LeonidS:
Hello!
U may change this part in tellfriend.php code for placing FirstName field instead NickName:
this one:
$profileID = 0;
change to the following:
(int)$_COOKIE['memberID'] : 0
'name' => array(
'type' => 'text',
'name' => 'name',
'caption' => _t("_Your name"),
'value' => $sVisitorName
),
instead $sVisitorName u may enter $aVisitorInfo['FirstName'] for example.
Regard
_________________________________________________________________
My response follows below:
Thanks, LeonidS, a couple of problems with this approach:
Firstly: (int)$_COOKIE['memberID'] : 0 should be (int)$_COOKIE['memberID'] = 0 otherwise a parsing error occurs.
Secondly: when I implement your approach, the sender is only able to use his/her first name. When the email then hits the inbox of the recipient, they are not really going to know who the email is from, if for instance, the first name is a common name like "John" or "Joe". A similar problem of course occurs when the default nickname is used.
So, is there a way to include BOTH firstname and surname fields and have the emails signed with both of them?
Also, although this is a helpful reply, it didn't really answer my question - I gather therefore that it is NOT possible to prefill the fields?
I've adjusted the language file to prompt users to use their login name and their registered email - that's just about all I can think of to stop users from being frustrated when the "email send failed" message keeps coming up.
Thanks for your response, though.
Wizard247