Skip to content

Commit

Permalink
do not send allergy email to community team
Browse files Browse the repository at this point in the history
  • Loading branch information
timiwahalahti authored and iandunn committed Jul 17, 2023
1 parent ea05b99 commit efd331c
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,12 @@ protected function maybe_send_notification_email( $value, $attendee ) {
$post_type_object = get_post_type_object( $attendee->post_type );
$attendee_link = add_query_arg( 'action', 'edit', admin_url( sprintf( $post_type_object->_edit_link, $attendee->ID ) ) );
$handbook_link = 'https://make.wordpress.org/community/handbook/wordcamp-organizer/planning-details/selling-tickets/life-threatening-allergies/';
$support_email = '[email protected]';
$recipients = array(
$current_wordcamp->meta['Email Address'][0], // Lead organizer
$current_wordcamp->meta['E-mail Address'][0], // City address
$support_email,
);

foreach ( $recipients as $recipient ) {
if ( $support_email === $recipient ) {
// Make sure the email to WordCamp Central is in English.
add_filter( 'locale', array( $this, 'set_locale_to_en_US' ) );
}

$subject = sprintf(
/* translators: Email subject line. The %s placeholder is the name of a WordCamp. */
wp_strip_all_tags( __( 'An attendee who has a life-threatening allergy has registered for %s', 'wordcamporg' ) ),
Expand All @@ -344,9 +337,6 @@ protected function maybe_send_notification_email( $value, $attendee ) {
$message_line_1 = wp_strip_all_tags( __( 'The following attendee has indicated that they have a life-threatening allergy. Please note that this information is confidential.', 'wordcamporg' ) );

$message_line_2 = wp_strip_all_tags( __( 'Please follow the procedure outlined in the WordCamp Organizer Handbook to ensure the health and safety of this event\'s attendees.', 'wordcamporg' ) );
if ( $support_email === $recipient ) {
$message_line_2 = 'Please check in with the organizing team to ensure they\'re following the procedure outlined in the WordCamp Organizer Handbook to ensure the health and safety of this event\'s attendees.';
}

$message = sprintf(
"%s\n\n%s\n\n%s\n\n%s",
Expand All @@ -356,10 +346,6 @@ protected function maybe_send_notification_email( $value, $attendee ) {
$handbook_link // Link to page in WordCamp Organizer Handbook.
);

if ( $support_email === $recipient ) {
remove_filter( 'locale', array( $this, 'set_locale_to_en_US' ) );
}

wp_mail( $recipient, $subject, $message );
}

Expand Down

0 comments on commit efd331c

Please sign in to comment.