Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Autofill code for clicked link from email??

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #241140
    Ehreekuh
    Participant

    So I have been tasked by my boss to try and figure out how to autofill a field in a form with the email address that received the link that was clicked.

    Back story:
    We are sending out links to an online scheduler and parents must use the email address at which they received the link (which is the same one tied to their child’s profile) to be able to book their child into an extra help session. Most of the parents either don’t read the directions we give them or just simply don’t understand. SO, we want to the email address in the form to auto populate with the email address that the link was clicked on..from..or whatever.

    I hope this makes sense, I am not versed in the CSS/HTML world and I am mostly self taught to keep my boss happy and expand my knowledge for self-satisfaction.

    Thank you SO much for looking at this post, I appreciate your time!

    Keep it Rockin’,
    Ehreekuh

    #241146
    I.m.learning
    Participant

    Sounds like PHP.

    I use PHP to include my header so I only have to change 1 page and not every single page.

    <?php
    $emailMap = array(“firstname1lastname1″=>”[email protected]”,
    “firstname2lastname2″=>”[email protected]”); ?>

    <input type=’text’ name=’emailTo’ value='<?= isset($emailMap[$_GET[“email”]])?$emailMap[$_GET[“email”]]:””) ?>’/>

    #241153
    Beverleyh
    Participant

    Let me see if I understand;

    1. You send out an email to parents
    2. Email contains link to book a help session
    3. You want the link that they click on (in the message body of the received email) to auto-populate the email field of the help session booking form

    Is that right?

    You could do it if you have control of the email sending script and the session booking form page.

    You could first edit the email sending script so that the link to the session booking page/form contained in the message body, has their email address appended as a query string;

    http://mywebsite.com/[email protected]
    

    Then at the top of the form page, use PHP to GET the query string (the email) and auto-populate the form field for the email address;

    <?php $email_from_link = isset($_GET['email']) ? $_GET['email'] : '';?>
    

    And for the form field – populate the ‘value’ attribute;

    <input type="text" name="email" value="<?php echo $email_from_link;?>">
    
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.