• Resolved KoolPal

    (@koolpal007)


    Hi,

    There is no front end provision under Settings -> Emails to change Subject and Heading for Report Abuse email

    Please guide how to change these

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Ali Akbar Reyad

    (@alireyad)

    Hi,
    You can do it using filter hook. Add following code in child theme functions.php file –

    add_filter('rtcl_email_heading_report_abuse', function(){
        return esc_html__( "Heading text here", 'classified-listing');
     });
    add_filter('rtcl_email_subject_report_abuse', function(){
        return esc_html__( "Subject text here", 'classified-listing');
     });

    Thank you

    Thread Starter KoolPal

    (@koolpal007)

    Hi,

    Thanks for the quick response

    This code snippet does not support variables like {listing_title} and {site_title}

    How do we address this?

    Please guide.

    Plugin Support Ali Akbar Reyad

    (@alireyad)

    Yes, you can do it. Check following code –

    add_filter( 'rtcl_email_subject_report_abuse', function ( $text, $email ) {
    	return sprintf(
    		__( 'Your listing title %1$s Site link %2$s', 'classified-listing' ),
    		esc_html( $email->get_placeholders_item( '{listing_title}' ) ),
    		esc_url( $email->get_placeholders_item( '{site_link}' ) )
    	);
    }, 99, 2 );

    Thank you

    Thread Starter KoolPal

    (@koolpal007)

    Hi,

    Thanks for the reply but something is not correct

    I am trying to achieve the below for Report Abuse emails

    Subject: {site_title} Report for {listing_title}

    Heading: Your Report on {listing_title}

    When I tested your latest code snippet, I got the error:
    PHP Fatal error: Uncaught Error: Call to undefined method Rtcl\Models\Listing::get_placeholders_item() in [path]\wp-content\themes\classima-child\functions.php:94

    Please check and guide.

    Thanks

    Plugin Support Ali Akbar Reyad

    (@alireyad)

    okay, try following code –

    add_filter( 'rtcl_email_subject_report_abuse', function ( $text, $listing ) {
    	return sprintf(
    		__( '<a href="%s">%s</a> Report for %s', 'classified-listing' ),
    		esc_url( \Rtcl\Helpers\Functions::get_home_url() ),
    		esc_html( \Rtcl\Helpers\Functions::get_blogname() ),
    		$listing->get_the_title(),
    	);
    }, 99, 2 );
    
    add_filter( 'rtcl_email_heading_report_abuse', function ( $text, $email ) {
    	return sprintf(
    		__( 'Your Report on %1$s', 'classified-listing' ),
    		esc_html( $email->get_placeholders_item( '{listing_title}' ) )
    	);
    }, 99, 2 );

    Thank you

    Thread Starter KoolPal

    (@koolpal007)

    Thanks! I needed to tweak this a bit further to fix it.

    May I request your team to add such emails in Admin at Classified Listing -> Email -> Email template – like you have added all other emails sent by your plugin?

    It will help everybody avoid such gymnastics in functions.php ??

    Please consider the below email as well:

    From Admin -> All Listings -> Individual Listing -> Send email to user

    Plugin Support Ali Akbar Reyad

    (@alireyad)

    Hi,
    Thanks for your suggestions. We will consider about it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Report Abuse – Change Subject / Heading’ is closed to new replies.