• Closed
  • Anatoly Valenti
    Spectator
    November 8, 2014 at 4:31 am #13470

    I use JavaScript to dynamically change certain content of my pages depending on the URL the visitor used to enter my site. For example:
    – kate.powerofaloe.com opens “Contact Us” page with Kate’s phone number.
    – john.powerofaloe.com opens “Contact Us” page with John’s phone number.
    I use the following line of code: <script>javascript:document.write(getParamValue(‘phone’));</script>
    QUESTION: Where can I add this code for the Contact Page so that the form generates an email to either Kate or John? Thank you.

    Alok Maheshwari
    Spectator
    Posts: 303
    November 8, 2014 at 8:39 am #13472

    john.powerofaloe.com is not opening.

    Anatoly Valenti
    Spectator
    Posts: 26
    November 8, 2014 at 8:40 am #13473

    Oh, try marina.powerofaloe.com.

    Alok Maheshwari
    Spectator
    Posts: 303
    November 8, 2014 at 10:11 am #13474

    Can you please explain how are you currently making the phone change work and then we can figure out how to do the same for the email.

    Anatoly Valenti
    Spectator
    Posts: 26
    November 8, 2014 at 5:58 pm #13475

    Hi Alok, Here is an example of how I make the change in the footer.

    Appearance -> Theme Options -> Footer -> Copyright Options

    I have the following: This site is provided to you by: <script>javascript:document.write(getParamValue(‘fullName’) + ” Phone: ” + getParamValue(‘phone’));</script>

    <span style=”font-size: 12.8000001907349px;”>The information about marina and kate (their name, phone, email) is recorded in an XML file.</span><span style=”font-size: 12.8000001907349px;”> When you e</span>nter the site as marina.powerofaloe.com or kate.powerofaloe.com, JavaScript reads the name from the tpl value in the URL and drops a cookie. When the page is loaded it reads the cookie and parameters from the XML file and displays them on the page.

    As you may see, I’ve done this for the footer and the contact us page. Where can I do this for the email address in the Contact Form?

    Alok Maheshwari
    Spectator
    Posts: 303
    November 8, 2014 at 8:36 pm #13477

    Drop an email cookie named distributor_email containing the email address and then you can replace line 62 in contact.php from

    $emailTo = $data['email_address'];

    to

    $emailTo = $_COOKIE['distributor_email']!='' ? $_COOKIE['distributor_email'] : $data['email_address'];

    Anatoly Valenti
    Spectator
    Posts: 26
    November 9, 2014 at 5:34 am #13479

    Thank you very much. I will give it a try and will let you know.

    Anatoly Valenti
    Spectator
    Posts: 26
    November 14, 2014 at 6:45 am #13512

    Many thanks again for suggesting the solution. Problem solved!