• 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?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, @dzseti!

    We don’t directly support customizations in our plugin or provide support or guidance on custom shortcodes. If you need help to make the custom code work, you can reach out to a developer of Codeable on this link.

    Have a nice day!

    Thread Starter dzseti

    (@dzseti)

    Hi

    Don’t quite understand your reply “We don’t directly support … guidance on custom shortcodes”

    Who is providing this support on shortcodes? Not MailPoet?

    What this support doesn’t say is that the link generated is an intermediate link that does redirect to the link I had set up.

    Hi again, @dzseti!

    We took a further look into the problem you described and we think it can be related to a similar issue that was reported in our GH repository. Could you please check the public issue and see if that helps? Here’s the link:

    https://github.com/mailpoet/mailpoet/issues/3393

    If not, please feel free to open a new issue in there (so our devs can take a look) or provide more insights in this forum thread.

    Thanks!

    Thread Starter dzseti

    (@dzseti)

    Thanks for getting back. I’ll get over my frustration at your first reply. Maybe both having a bad day.

    I took a look at the link you sent and it has helped my understanding. Many thanks

    Still think you need to be clear on the [link:….] description page you should be clearer that this generates and intermediate link that redirects to the programmed link. Fundamental to the operation of MailPoet, but something I didn’t udnerstand at the start

    All sorted now. Many thanks

    Hi!

    I’ll get over my frustration at your first reply. Maybe both having a bad day.

    No problem. I misunderstood your question at the beginning, so my bad here. Actually, thanks for getting back to me so I could take a further look and understand what you were looking for.

    Still think you need to be clear on the [link:….] description page you should be clearer that this generates and intermediate link that redirects to the programmed link.

    Totally, I’ll write down that feedback so we can include that part in our support documentation.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘custom link shortcode in theme functions.php file not working’ is closed to new replies.