Skip to content

Commit

Permalink
Add accomodation default text and email template textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Marks committed Jun 1, 2022
1 parent 9a1ab72 commit 5ac9e9b
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public function camptix_init() {
add_filter( 'camptix_privacy_export_attendee_prop', array( $this, 'export_attendee_prop' ), 10, 4 );
add_filter( 'camptix_privacy_attendee_props_to_erase', array( $this, 'attendee_props_to_erase' ) );
add_action( 'camptix_privacy_erase_attendee_prop', array( $this, 'erase_attendee_prop' ), 10, 3 );

// E-mail template
add_filter( 'camptix_custom_email_templates', array( $this, 'register_custom_email_templates' ) );
add_filter( 'camptix_default_options', array( $this, 'custom_email_template_default_values' ) );
}

/**
Expand Down Expand Up @@ -521,6 +525,35 @@ public function erase_attendee_prop( $key, $type, $post ) {
update_post_meta( $post->ID, $key, $anonymized_value );
}
}

/**
* Add an e-mail template for accessibility accommodations.
*
* @param array $templates
*
* @return array
*/
public function register_custom_email_templates( $templates ) {
$templates['email_template_accessibility_accommodations'] = array(
'title' => __( 'Accessibility Accommodations', 'wordcamporg' ),
'callback_method' => 'field_textarea',
);

return $templates;
}

/**
* Add the default e-mail template text for accessibility accommodations.
*
* @param array $options
*
* @return array
*/
public function custom_email_template_default_values( $options ) {
$options['email_template_accessibility_accommodations'] = __( "Hey there!\n\nWhen you registered your ticket, you answered 'Yes' to the question 'Do you have any accessibility needs, such as a sign language interpreter or wheelchair access, to participate in WordCamp?' If you made the choice by mistake, you can edit the ticket information from:\n\n[ticket_url]\n\nIf you do require an accessibility accommodation, would you be able to provide additional detail and anything related that we should be informed of by replying to this email?", 'wordcamporg' );

return $options;
}
}

camptix_register_addon( __NAMESPACE__ . '\Accommodations_Field' );

0 comments on commit 5ac9e9b

Please sign in to comment.