How can I format email notification after registration?

wp_mail from Codex Use this example: add_filter( ‘wp_mail_content_type’, ‘set_html_content_type’ ); wp_mail( $mails_to, ‘The subject’, ‘<p>The <em>HTML</em> message</p>’ ); // Reset content-type to avoid conflicts — http://core.trac.wordpress.org/ticket/23578 remove_filter( ‘wp_mail_content_type’, ‘set_html_content_type’ ); function set_html_content_type() { return ‘text/html’; }

how to display a string in admin_notices hook from a class plugin

Take a look at what happens when you activate a plugin. That is, watch the event with something like HttpFox or Wireshark. After activation the page is redirected back to itself with $_GET parameters appended. For example: wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s= Notice, activate=true?. Your code isn’t working, I am pretty sure, because there are two requests involved. You … Read more

Removing sensitive information from comment notifications – notify_post_author

There is a hook that should let you alter that data– comment_notification_text. add_action( ‘comment_notification_text’, function($notify_message,$comment_id) { var_dump($notify_message,$comment_id); die; }, 10,2 ); You could parse that $notify_message string and remove the parts you don’t want. add_filter( ‘comment_notification_text’, function($notify_message) { $notify_message = explode(“\n”,$notify_message); foreach ($notify_message as $k => $line) { $header = trim(substr($line,0,strpos($line,’:’))); switch ($header) { case … Read more

Post Status Frontend Announcement

You can create an easy to use function to do that for you. Like so: <?php function sg_user_posts_by_type($userid, $post_status) { $args = array( ‘numberposts’ => -1, ‘post_status’ => array($post_status), ‘author’ => $userid ); $count_posts = count(get_posts($args)); return $count_posts; } if (is_user_logged_in()) { // GET CURRENT USER DATA $user_id = get_current_user_id(); $user_data = get_userdata($user_id); $publish_count = … Read more

send new post notification to an email address stored in a custom field value

I think this would be possible using the wp_mail() function (https://developer.wordpress.org/reference/functions/wp_mail/) alongside the publish_post action. In fact, the publish_post action codex page has an example: https://codex.wordpress.org/Plugin_API/Action_Reference/publish_post function post_published_notification( $ID, $post ) { $author = $post->post_author; /* Post author ID. */ $name = get_the_author_meta( ‘display_name’, $author ); $email = get_the_author_meta( ‘user_email’, $author ); $title = $post->post_title; … Read more

Send email messages after comment was submitted

For comment approved, you can review this question Approve comment hook? For comment submitted, you can hook into the comment_post hook, like function show_message_function( $comment_ID, $comment_approved ) { if( 0 === $comment_approved ){ //function logic goes here } } add_action( ‘comment_post’, ‘show_message_function’, 10, 2 ); Code copied from https://developer.wordpress.org/reference/hooks/comment_post/

Register new user, assign custom role then send email

TO really fit your needs, I think it’s better to rewrite some part of wp_insert_user() function, some part can interrest you $user_email = apply_filters( ‘pre_user_email’, $raw_user_email ); And : $illegal_logins = (array) apply_filters( ‘illegal_user_logins’, array() ); if ( in_array( strtolower( $user_login ), array_map( ‘strtolower’, $illegal_logins ) ) ) { return new WP_Error( ‘invalid_username’, __( ‘Sorry, … Read more

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