Biggest Sale of the year

Union (5)
Countdown Timer reference
10
Days
:
10
Hours
:
05
Minutes
:
10
Seconds
Grab My Black Friday Deal

Documentation

s2_custom_keywords

This hook was introduced in version 9.3 of Subscribe2. It allows for developers to add their own custom keywords to Subscribe2 for inclusion in the notification template. The following code adds a {BITLYLINK} keyword to use in place of the current {PERMALINK} or {TINYLINK} keywords.

function bitly_keyword( $string, $token = 'PUT YOUR API TOKEN HERE') {
    global $mysubscribe2;
    $link = $mysubscribe2->get_tracking_link( $mysubscribe2->permalink );
    $bitlydata = wp_remote_get('https://api-ssl.bitly.com/v3/shorten?access_token=' . $token . '&longUrl=' . urlencode($link));
    $data = json_decode( wp_remote_retrieve_body( $bitlydata ) );
    if  ( 'ok' === strtolower($data->status_txt) && 200 === (int)$data->status_code ) {
        $bitlylink = '<a>data->url . '">' . $data->data->url . '</a>';
    } else {
        $bitlylink = '<a href="' . $link . '">' . $link . '</a>';
    }
    return str_replace('{BITLYLINK}', $bitlylink, $string);
}
add_filter('s2_custom_keywords', 'bitly_keyword');
Still stuck? Contact

How can we help?

Contact Us

Reach out to us for any inquiry

You must enter full name
You must enter email
You must enter message

We got your message

We will reply to you very soon :)

Exit intent popup

WAIT! We're Beating Our Own Black Friday Deal!

Apply this:

00Days
00Hours
00Min
00Sec
Claim Yours & Save Over $1398