AnsPress_Email_Hooks::select_answer( object $_post )
Description #
Notify answer author that his answer is selected as best.
Parameters #
- $_postobject (Required) Selected answer object.
Source #
File: addons/free/email.php
public static function select_answer( $_post ) { if ( get_current_user_id() === $_post->post_author || ! ap_opt( 'email_user_select_answer' ) ) { return; } $args = array( 'users' => [ 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( strip_tags( $_post->post_content ), 100 ), ); $email = new Email( 'select_answer', $args ); $email->send_emails(); }
Expand full source code Collapse full source code View on GitHub: addons/free/email.php:368
Add your comment