diff --git a/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php b/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php index a156505088..3e620fc999 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-application.php @@ -132,10 +132,15 @@ public function submit_application( $post_data ) { $message = $application_data->get_error_message(); $notice_classes = 'notice-error'; } else { - $this->create_post( $application_data ); + $application_post = $this->create_post( $application_data ); + if ( is_wp_error( $application_post ) ) { + // Set application post to an int, rather than wp_error. + $application_post = 0; + } $this->notify_applicant_application_received( $this->get_organizer_email(), - $this->get_event_location() + $this->get_event_location(), + $application_post ); $this->notify_new_application_in_slack(); @@ -253,8 +258,9 @@ public function display_notice( $message, $notice_classes ) { * * @param string $email_address * @param string $event_city + * @param int $application_post id of post created on WC Central. */ - public function notify_applicant_application_received( $email_address, $event_city ) { + public function notify_applicant_application_received( $email_address, $event_city, $application_post = 0 ) { //translators: Name of the event. E.g. WordCamp or meetup. $subject = sprintf( __( "We've received your %s application", 'wordcamporg' ), $this->get_event_label() ); $headers = array( @@ -265,12 +271,26 @@ public function notify_applicant_application_received( $email_address, $event_ci //translators: 1: Name of the event. 2: City of the event. $message = sprintf( __( - "Thank you for applying to organize a %1\$s in %2\$s! We'll send you a follow-up e-mail once we've had a chance to review your application.", + "Thank you for applying to organize a %1\$s in %2\$s! We'll send you a follow-up e-mail once we've had a chance to review your application.\n\n", 'wordcamporg' ), $this->get_event_label(), sanitize_text_field( $event_city ) ); + $message .= sprintf( + "---- Internal details for the Community Team ----\n + Name: %1\$s\n + Type: %2\$s", + $this->get_event_label(), + sanitize_text_field( $event_city ), + ); + + if ( 0 !== $application_post ) { + $message .= sprintf( + "\nURL: https://central.wordcamp.org/wp-admin/post.php?post=%1\$d&action=edit", + absint( $application_post ) + ); + } wp_mail( $email_address, $subject, $message, $headers ); } diff --git a/public_html/wp-content/plugins/wcpt/wcpt-events/class-events-application.php b/public_html/wp-content/plugins/wcpt/wcpt-events/class-events-application.php index 51cc7bb437..2619573d3c 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-events/class-events-application.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-events/class-events-application.php @@ -145,7 +145,7 @@ public function get_default_application_values() { * * @param array $data * - * @return bool|WP_Error + * @return int|WP_Error */ public function create_post( $data ) { // Create the post. @@ -201,7 +201,7 @@ public function create_post( $data ) { $this->post = get_post( $post_id ); - return true; + return $post_id; } /** diff --git a/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-application.php b/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-application.php index c2a81c0941..562edf64c3 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-application.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-meetup/class-meetup-application.php @@ -207,7 +207,7 @@ public function get_default_application_values() { * * @param array $data * - * @return bool|WP_Error + * @return int|WP_Error */ public function create_post( $data ) { // Create the post. @@ -264,7 +264,7 @@ public function create_post( $data ) { $this->post = get_post( $post_id ); - return true; + return $post_id; } /** diff --git a/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/class-wordcamp-application.php b/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/class-wordcamp-application.php index 38c10dfa89..71e5e470a1 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/class-wordcamp-application.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/class-wordcamp-application.php @@ -186,7 +186,7 @@ public static function get_application_report_url() { * * @param array $data * - * @return bool|\WP_Error + * @return int|\WP_Error */ public function create_post( $data ) { // Create the post. @@ -259,7 +259,7 @@ public function create_post( $data ) { ); $this->post = get_post( $post_id ); - return true; + return $post_id; } /**