Notification email, sample code.
-
Hi, if someone needs to send a notification, this might get you started:
function samen_bbp_rc_reported_topic( $topic_id ) { $topic = bbp_get_topic( $topic_id ); $subject = 'Forum message reported'; // Set the Mail Content $mail_body = ' Hello, Somebody reported a forum post. Have a good day. The editors of this website. Forum message: ' . get_permalink( $topic_id ) . ' Manage that message: ' . admin_url( '/post.php?post=' . $topic_id . '&action=edit' ) . ' '; // Set the Mail Headers $header = "From: " . " <" . get_bloginfo('admin_email') . ">\r\n"; $header .= "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail wp_mail( get_bloginfo('admin_email'), $subject, $mail_body, $header ); } add_action( 'bbp_rc_reported_topic', 'samen_bbp_rc_reported_topic' );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Notification email, sample code.’ is closed to new replies.