Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: {email_url} fail function "404" or "Invalid Newsletter" #66174
    dk
    Participant
    in reply to: Web version not working #65009
    dk
    Participant

    Here’s a short story:

    A Newsletter is scheduled for today 2am. Although being really tired I want to make sure everything works out just as expected. Now, just a few seconds past two – after sending to a really large number of recipients has started, I notice, that the {email_url} shortcode does not work! Fortunatelly, my emailaddress was the first on the list. By the way, it neither worked in the test-mail, but I thought, this is just due to being a test…

    So I immediatelly hit STOP. Now, what would you do in my case at 2am?
    Proceed, sending a couple thousand emails with non working web url promoted prominently in the preheader section?

    Here’s what I just did:

    – Google returns nothing.

    – Checking this forum gives me two threads on the first page complaining, that {email_url} is apparently broken.

    Since I am not really keen to justify myself in just a few hours, I started searching for the search-and-replace functions. This is what I found:

    Starting at line 1062 in newsletter/includes/module.php

    if (!empty($email_id)) {
    $text = $this->replace_url($text, ‘EMAIL_URL’, $home_url . ‘?na=v&id=’ . $email_id . ‘&nk=’ . $nk);
    }

    For reasons unknown, $email_id is empty, so {email_url} does not get replaced.

    However, few lines above, you can see, that {unsubscription_url} makes use of the same URL-parameter (nek). This is being parsed correct with an id set. So to keep it short, I just replaced the above lines of code as follows:


    if (!empty($email)) {
    $text = $this->replace_url($text, ‘EMAIL_URL’, $home_url . ‘?na=v&id=’ . $email->id . ‘&nk=’ . $nk);
    }

    Voila!

    Perhaps you can imagine my joy after I fixed this code and gently pressed the ‘proceed’ button.
    (Of course after receiving a test and confirmed the working web URL, that is 🙂

    Time to go to bed 🙂 Good night!

    Edit: Version is 5.1.9

Viewing 2 posts - 1 through 2 (of 2 total)