• Resolved dzseti

    (@dzseti)


    As per this article I have set up a custom link as indicated:

    function mailpoet_custom_shortcode_referral_link($shortcode, $newsletter, $subscriber, $queue, $arguments) {
      // always return the shortcode if it doesn't match your own!
      if ($shortcode !== '[link:cj]') return $shortcode;
    	
      $referral_link = get_page_link(get_page_by_title('curated journeys live feed')->ID) . '?email=xxxx';
      
      return $referral_link;
    }

    On a test page the set value

    get_page_link(get_page_by_title(‘curated journeys live feed’)->ID) . ‘?email=xxxx’

    is correct. It shows the value

    https://example.com/6ge628fd7e/?email=xxxx

    But the email itself includes a link like this:

    https://example.com/?mailpoet_router&endpoint=track&action=click&data=WzI2LCIyNzVjYzciLCI0IiwiM2RkMjNiNGQ1ODg0IixmYWxzZV0

    ie there are two problems:

    (1) the part of the url after the domain name

    6ge628fd7e/

    has been dropped
    (2) the get data

    ?email=xxxx

    has been replaced by tracking data

    What am I doing wrong?

    • This topic was modified 3 years, 5 months ago by dzseti.
    • This topic was modified 3 years, 5 months ago by dzseti.
    • This topic was modified 3 years, 5 months ago by dzseti.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘custom link shortcode not working’ is closed to new replies.