Customize user email depending on cpt

This topic contains 5 replies, has 4 voices, and was last updated by  Alex Rollin 3 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #538694

    periwinkle
    Expired Member
    Post count: 29

    Is it possible to customizd the text of the users email depending on custom post type?

    I need to add a special link only in the email to users that add a listing in a specific cpt

    #538756

    Kor
    Moderator
    Post count: 16516

    Hi periwinkle

    Thanks for your reply. Sorry, what you needed there isn’t something that is currently possible to achieve out of the box. But I’ll forward this to a developer for a second opinion.

    #538950

    Naveen Giri
    Moderator
    Post count: 1559

    Hi, periwinkle

    you can use the below filter to add an additional link based on the CPT type.
    I have included that link for gd_place CPT, you can use other cpt there.

    
    add_filter('geodir_email_content','geodir_email_user_publish_post_body_callbackk', 10, 3 );
    function geodir_email_user_publish_post_body_callbackk( $content, $email_name, $email_vars ){
    		$gd_post = ! empty( $email_vars['post'] ) ? $email_vars['post'] : null;
    		if ( empty( $gd_post ) && ! empty( $email_vars['post_id'] ) ) {
    			$gd_post = geodir_get_post_info( $email_vars['post_id'] );
    		}
    	if( 'gd_place' === $gd_post->post_type ){ // make sure to change the post type gd_place to your own cpt. 
    		$content = $content.'Extra link';
    	}
    	return $body;
    }
    

    It’s a customization request so for any further customization you can take the help of our GD experts.
    http://geodirectoryexperts.com/

    Regards
    Naveen

    geodir_email_user_publish_post_body

    #540093

    periwinkle
    Expired Member
    Post count: 29

    Thank you!

    #543404

    periwinkle
    Expired Member
    Post count: 29

    Hi,
    is it possible to modify this code and customzie the email depending on the package?
    And send some information onl to useres thata have subscribed a specific package

    #543410

    Alex Rollin
    Moderator
    Post count: 27815

    For any further customization you can take the help of our GD experts.
    http://geodirectoryexperts.com/

    Regards

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket