Email::select_answer( object $_post )
Description #
Notify answer author that his answer is selected as best.
Parameters #
- $_postobject (Required) Selected answer object.
Source #
File: addons/email/email.php
public function select_answer( $_post ) { if ( get_current_user_id() === $_post->post_author || ! ap_opt( 'email_user_select_answer' ) ) { return; } $args = array( 'users' => array( get_the_author_meta( 'email', $_post->post_author ), ), ); $args['tags'] = array( '{selector}' => ap_user_display_name( get_current_user_id() ), '{question_title}' => $_post->post_title, '{answer_link}' => wp_get_shortlink( $_post->ID ), '{answer_content}' => $_post->post_content, '{answer_excerpt}' => ap_truncate_chars( wp_strip_all_tags( $_post->post_content ), 100 ), ); $email = new EmailHelper( 'select_answer', $args ); $email->send_emails(); }
Expand full source code Collapse full source code View on GitHub: addons/email/email.php:412
Add your comment