AnsPress_Email_Hooks::ap_after_new_question( integer $question_id )
Description #
Send email to admin when new question is created.
Parameters #
- $question_idinteger (Required) Question ID.
Source #
File: addons/free/email.php
public static function ap_after_new_question( $question_id ) { $args = []; $admin_emails = self::get_admin_emails( 'email_admin_new_question' ); if ( ! empty( $admin_emails ) ) { $args['users'] = $admin_emails; } // Return if no users. if ( empty( $args['users'] ) ) { return; } $question = ap_get_post( $question_id ); $args['tags'] = array( '{asker}' => ap_user_display_name( $question->post_author ), '{question_title}' => $question->post_title, '{question_link}' => wp_get_shortlink( $question->ID ), '{question_content}' => apply_filters( 'the_content', $question->post_content ), '{question_excerpt}' => ap_truncate_chars( strip_tags( $question->post_content ), 100 ), ); $email = new Email( 'new_question', $args ); $email->send_emails(); }
Expand full source code Collapse full source code View on GitHub: addons/free/email.php:294
Add your comment