Email::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/email/email.php
public function ap_after_new_question( $question_id ) { $args = array(); $admin_emails = $this->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( wp_strip_all_tags( $question->post_content ), 100 ), ); $email = new EmailHelper( 'new_question', $args ); $email->send_emails(); }
Expand full source code Collapse full source code View on GitHub: addons/email/email.php:333
Add your comment