• Resolved yourschools

    (@yourschools)


    I can get emails to send on a new Post being published but when I change the settings to send on my New CPT Publish it does not work.

    I have added the SMTP plugin you recommended and added a DKIM to my DNS. I have deactivated the members plugin(And for now only trying to send to the administrator, aka me)

    My CPT is marked public, and I have pasted the function below so you can review my CPT settings. Thank again

    add_action( ‘init’, ‘hp_mitchell_area’);
    function hp_mitchell_area() {
    register_post_type(‘hp_mitchell_area’,
    array(
    ‘labels’ => array(
    ‘name’ => ‘Mitchell Area’,
    ‘singular_name’ => ‘Mitchell’,
    ‘add_new’ => ‘Add New Alert’,
    ‘add_new_item’ => ‘Add New Alert for the Mitchell Area’,
    ‘edit’ => ‘Edit’,
    ‘edit_item’ => ‘Edit Alert’,
    ‘new_item’ => ‘New Alert’,
    ‘view’ => ‘View’,
    ‘view_item’ => ‘View Mitchell Area Alert’,
    ‘search_items’ => ‘Search Mitchell Area Alerts’,
    ‘not_found’ => ‘No Alerts from Mitchell found’,
    ‘not_found_in_trash’ => ‘No Alerts from Mitchell found in trash’,
    ‘parent’ => ‘Parent Alert’,
    ),

    ‘public’ => true,
    ‘menu_position’ => 15,
    ‘hierarchical’ => false,
    ‘supports’ => array(‘editor’, ‘revisions’),
    ‘show_ui’ => true,
    ‘has_archive’ => ‘cancellations-and-delays/hp_mitchell_area’,
    ‘rewrite’ => true,
    ‘capability_type’ => array( ‘alert’, ‘alerts’ ),
    ‘map_meta_cap’=> true
    )
    );

    }

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @yourschools,
    Thanks for your message.

    So am I right in thinking that you can set-up notifications for this custom post type but they fail to send / deliver?

    Thanks,
    Jack

    Thread Starter yourschools

    (@yourschools)

    Yes that is correct, custom post types are showing. I select the equivalent to New Post Published under the CPT but nothing happens.

    Thread Starter yourschools

    (@yourschools)

    I have also tried disabling every plugin I have, Except for Better Notifications for Worpdress and Postman SMTP but same result.

    Thread Starter yourschools

    (@yourschools)

    Hi Jack, I have been doing some troubleshooting of my own and in my custom Post Type I automatically add a title to the post using this function as we do not want users type their own. I commented it out and it worked. Any idea what the conflict would be? As always thanks for your support

    function hp_alert_titles($data, $postarr){
    if($data[‘post_type’] == ‘hp_mitchell_area’){ $data[‘post_title’] = ‘Mitchell Area’; }
    return $data;
    }
    add_filter(‘wp_insert_post_data’, ‘hp_alert_titles’, 10, 2);

    Plugin Author bnfw

    (@voltronik)

    Hi @yourschools,
    Thanks for the update.

    It will be the wp_insert_post_data() function that is causing issues. I think it’s because BNFW can’t detect post status transitions on wp_insert_post() as it adds posts directly to the database as opposed to passing through draft to publish, for example.

    I’m not sure what to suggest to overcome this at present except for to have posts go into ‘pending review’ status instead of published at which point they can be reviewed before being posted. That way, you can ensure consistency in post titles whilst allowing users to add their own posts, perhaps with some conditions of what they should be.

    Does this help?

    Thanks,
    Jack

    Plugin Author bnfw

    (@voltronik)

    Closing due to inactivity. If you need further help with this, please feel free to re-open this thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘New CPT Published Not Sending’ is closed to new replies.