Noptin_Link_Click_Trigger::get_rule_description( $rule )


Source Source

File: includes/automation-rules/triggers/class-noptin-link-click-trigger.php

    public function get_rule_description( $rule ) {
        $settings = $rule->trigger_settings;

        $campaign_id = empty( $settings['campaign_id'] ) ? 0 : (int) $settings['campaign_id'];
        $url = empty( $settings['url'] ) ? '' : noptin_clean_url( $settings['url'] );

        if ( empty( $campaign_id ) && empty( $url ) ) {
            return __( 'When a subscriber clicks on any link from any email campaign', 'newsletter-optin-box' );
        }

        if ( empty( $campaign_id ) ) {
            return sprintf(
                __( 'When a subscriber clicks on the link %s from any email campaign', 'newsletter-optin-box' ),
               "<code>$url</code>"
            );
        }

        $campaign_title = esc_html( get_the_title( $campaign_id ) );

        if ( empty( $campaign_title ) ) {
            $campaign_title = __( 'Deleted campaign', 'newsletter-optin-box' );
        }

        if ( empty( $url ) ) {
            return sprintf(
                __( 'When a subscriber clicks on any link from the email campaign %s', 'newsletter-optin-box' ),
               "<code>$campaign_title</code>"
            );
        }

        return sprintf(
            __( 'When a subscriber clicks on the link %s from the email campaign %s', 'newsletter-optin-box' ),
           "<code>$url</code>",
           "<code>$campaign_title</code>"
        );

    }


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation