cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
862
Views
0
Helpful
4
Replies

Single Click Guest Emailing Credentials to Sponsor

paul
Level 10
Level 10

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:

  1. Take a field like Company which we aren't using and change it to "Email Address" which is where the guest would put their email address.
  2. Change the text for the normal Email Address field to say "Person being visited"
  3. Hide the normal person being visited field.
  4. Somehow copy the input from #2 into the person being visited.

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?

1 Accepted Solution

Accepted Solutions

paul
Level 10
Level 10

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.

View solution in original post

4 Replies 4

Jason Kunst
Cisco Employee
Cisco Employee

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

paul
Level 10
Level 10

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.

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

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;
}