Support » Plugin: Newsletter Sign-Up » Change Redirect (Thank You) Page

  • Resolved w0lf42

    (@w0lf42)


    If you are using PHPList and have the ability to change the code (e.g. you are hosting it yourself), you can make a few changes that will let you control the redirect.

    WordPress Newsletter Plugin (this plugin)
    File includes\NSU_Form.php – line ~106
    Look for:
    $email_id = $opts[‘mailinglist’][’email_id’];
    Add this line after it:
    $nsu_checkbox = $opts[‘checkbox’][‘redirect_to’];

    File includes\NSU_Form.php – line ~180
    Look for:
    $output .= ‘<form class=”nsu-form” id=”nsu-form-‘ . esc_attr( $formno ) .'” action=”‘ . esc_attr( $form_action ) . ‘” method=”post”>’;
    Add this line after it:
    $output .= ‘<input type=”hidden” name=”nsu_redirect_to” value=”‘ . $nsu_checkbox . ‘” />’;

    PHPList
    File admin\spageedit.php – line ~102
    Look for:
    $data[“thankyoupage”] = ‘<h3>’.$GLOBALS[“strThanks”].'</h3>’.”\n”. $GLOBALS[“strEmailConfirmation”];
    Add this line after it:
    $data[“redirectURL”] = “”;

    File admin\subscribelib2.php – line ~189
    Look for:
    htmlspecialchars(stripslashes($data[“thankyoupage”])));
    Add the following lines after it:
    $generalinfoHTML .= sprintf(‘<label for=”redirectURL”>%s</label><input type=”text” name=”redirectURL” value=”%s” size=”60″ />’,
    $GLOBALS[‘I18N’]->get(‘Redirect URL (leave empty for default)’),
    htmlspecialchars($data[“redirectURL”]));

    File admin\spageedit.php – line ~334 –
    Replace this:
    # personalise the thank you page
    if ($subscribepagedata[“thankyoupage”]) {
    $thankyoupage = $subscribepagedata[“thankyoupage”];
    } else {
    $thankyoupage = ‘<h3>’.$strThanks.'</h3>’.'<p class=”information”>’. $strEmailConfirmation.'</p>’;
    }
    }

    With:
    if ($subscribepagedata[“thankyoupage”]) {
    if ($_POST[‘nsu_redirect_to’]) {
    header(‘Location: ‘ . $_POST[‘nsu_redirect_to’]);
    } else {
    $thankyoupage = $subscribepagedata[“thankyoupage”];
    }
    } else {
    if ($_POST[‘nsu_redirect_to’]) {
    header(‘Location: ‘ . $_POST[‘nsu_redirect_to’]);
    } else {
    $thankyoupage = ‘<h3>’.$strThanks.'</h3>’.'<p class=”information”>’. $strEmailConfirmation.'</p>’;
    }
    }

    https://wordpress.org/plugins/newsletter-sign-up/

  • The topic ‘Change Redirect (Thank You) Page’ is closed to new replies.