Send mail to author when custom post type is saved

Try this way: function send_emails_on_new_event( $post ) { $emails=”[email protected]”; $headers=”From: Name <[email protected]>”; $title = wp_strip_all_tags( get_the_title( $post->ID ) ); $message=”New post created”; if ( get_post_type( $post->ID ) === ‘documents’ ) { wp_mail( $emails, ‘New Post’, $message, $headers ); } } add_action( ‘pre_post_update’, ‘send_emails_on_new_event’ ); From the Code Reference: pre_post_update: Fires immediately before an existing post … Read more

Use WordPress Site For Email List Functionality

Email accounts are not defined by WordPress. They are defined on your hosting account. Since your site is hosted as a sub-part of the mycondoplace.net, you would need them to create the email accounts – and probably an email ‘list’. But, there is a way to do this (even though plugin recommendations are not generally … Read more

Send email to author of the post when the custom post status changes to published

This should work — make sure to change my_custom_type to the correct CPT slug: add_action( ‘transition_post_status’, ‘notify_author_on_publish’, 10, 3 ); function notify_author_on_publish( $new_status, $old_status, $post ) { if ( ‘publish’ !== $new_status || $new_status === $old_status || ‘my_custom_type’ !== get_post_type( $post ) ) { return; } // Get the post author data. if ( ! … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)