10-20-2017 07:46 AM
I am working on a large single click guest setup where the guest will not always have access to the Internet to receive the email with their credentials and the customer doesn't want the normal sponsors to log into the sponsor portal to retrieve the credentials. They would like the credential email to go to the sponsor instead of the guest.
I don't think there is a way do this natively, but want to see if I can do it using java script. Here is what I am thinking:
So at the end of the day the email address and person being visited would be the sponsor's email address and what was the Company name variable would contain the guest's email address.
The only piece I am unsure how to do is copy one variable into another.
Thoughts?
Solved! Go to Solution.
01-10-2018 11:49 AM
I just got around to testing this and worked perfectly. I turned the email address field which normally is the guest email address into the person being visited field (i.e. changed the text) and used the following java script to copy it to the person being visit variable:
<script>
$("[name='selfRegForm']").focusin(function(){
$("input[name='guestUser.fieldValues.ui_person_visited']").closest(".ui-field-contain").hide();
});
$("[name='selfRegForm']").submit(function(){
var company = $("input[name='guestUser.fieldValues.ui_email_address']").val();
$("input[name='guestUser.fieldValues.ui_person_visited']").val($("input[name='guestUser.fieldValues.ui_email_address']").val());
});
</script>
Sponsor gets the email request to single click approve. Sponsor gets the email with guest credentials once approved.
10-20-2017 07:56 AM
Check out the phone number as a username post in the Community
It does a copy but also hides some text
Sent from my iPhone
01-10-2018 11:49 AM
I just got around to testing this and worked perfectly. I turned the email address field which normally is the guest email address into the person being visited field (i.e. changed the text) and used the following java script to copy it to the person being visit variable:
<script>
$("[name='selfRegForm']").focusin(function(){
$("input[name='guestUser.fieldValues.ui_person_visited']").closest(".ui-field-contain").hide();
});
$("[name='selfRegForm']").submit(function(){
var company = $("input[name='guestUser.fieldValues.ui_email_address']").val();
$("input[name='guestUser.fieldValues.ui_person_visited']").val($("input[name='guestUser.fieldValues.ui_email_address']").val());
});
</script>
Sponsor gets the email request to single click approve. Sponsor gets the email with guest credentials once approved.
02-08-2018 01:32 AM
Hi Paul,
Do you put this script under Guest portal/Registration form/Optional Content 2 ?
For me it does exactly the other way. send both approval request and the guest and not the sponsor.
And if I change the field in the script to:
var company = $("input[name='guestUser.fieldValues.ui_person_visited']").val();
$("input[name='guestUser.fieldValues.ui_email_address']").val($("input[name='guestUser.fieldValues.ui_person_visited']").val());
Then Sponsor receives bot approval email and credentials, which is the expected result.
But there is one problem. Because the email field is replaced by the sponsors email, the guest username will always be the sponsor email.
What do you think? Am i missing something obvious here?
Thanks,
laszlo
02-08-2018 04:19 AM
Nope the script I posted is correct and I have used it on 4-5 installs already.
So you change the text on the field for Guest email address to “Person being visited (email)”. So if you didn’t have the script the guest would see two fields that say “Person being visited (email)”. To prevent that the first part in optional Content 2 hides the original person being visited field:
$("[name='selfRegForm']").focusin(function(){
$("input[name='guestUser.fieldValues.ui_person_visited']").closest(".ui-field-contain").hide();
});
So now the guest is putting the sponsor email into the guest email field. Then you have to copy that field to the sponsor email field with the second part of the script. So you never really collect the guest email address. You could use over fields to still collect the guest email, but I don’t care about the guest email.
$("[name='selfRegForm']").submit(function(){
var company = $("input[name='guestUser.fieldValues.ui_email_address']").val();
$("input[name='guestUser.fieldValues.ui_person_visited']").val($("input[name='guestUser.fieldValues.ui_email_address']").val());
});
The other thing I have been doing standard on the login form is making the “Register for an account” text bigger by putting this in optional content 2 on the login page:
#ui_login_self_reg_button {
font-size:1.2em;
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide