How to make Wordpress automatically sent to subscribers on the new record?

Found some very feature-rich plugin for creating e-mail newsletters WordPress:
MailPoet - https://ru.wordpress.org/plugins/mailpoet/
Newsletter https://ru.wordpress.org/plugins/newsletter/
Huge functionality, capabilities, etc., but I just need that after the publication on the website of the new record came a letter in the mail (for a small list of e-mail ). Tell me, any simple working solutions.
March 19th 20 at 08:32
1 answer
March 19th 20 at 08:34
Solution
Found an interesting working solution (although the addresses need to be manually added):
my_project_updated_send_email function( $post_id ) {

 // If this is just a revision, don't send the email.
 if ( wp_is_post_revision( $post_id ) ) {
return;
}

 $post_title = get_the_title( $post_id );
 $post_url = get_permalink( $post_id );
 $subject = 'news';

 $message = "the New news:\n\n";
 $message .= $post_title . ": ". $post_url;

 // Send email to admin.
 wp_mail( 'info@yandex.ru', $subject, $message );
}
add_action( 'publish_post', 'my_project_updated_send_email' );

With a comma you can specify the required number of addresses. Checked, it works instantly.
This code inserted in a theme file functions.php
Distribution is done through email services. So your server in spam databases yourself. If you are satisfied with sending emails using this code, use a plugin WP Mail SMTP and configure WPForms by sending via Mailgun. - Niko.Strom commented on March 19th 20 at 08:37
MailPoet - https://ru.wordpress.org/plugins/mailpoet/ in the end figured out in the plugin settings and was able to configure notifications via SMTP. - Antoinette.Volkman61 commented on March 19th 20 at 08:40

Find more questions by tags WordPress