Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email templates and email attendees about their allergy or accommodation #777

Draft
wants to merge 2 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' );
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ 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 @@ -519,6 +524,35 @@ public function erase_attendee_prop( $key, $type, $post ) {
update_post_meta( $post->ID, $key, $anonymized_value );
}
}

/**
* Add an e-mail template for life-threatening allergies.
*
* @param array $templates
*
* @return array
*/
public function register_custom_email_templates( $templates ) {
$templates['email_template_life_threatening_allergy'] = array(
'title' => __( 'Life-threatening Allergy', 'wordcamporg' ),
'callback_method' => 'field_textarea',
);

return $templates;
}

/**
* Add the default e-mail template text for life-threatening allergies.
*
* @param array $options
*
* @return array
*/
public function custom_email_template_default_values( $options ) {
$options['email_template_life_threatening_allergy'] = __( "Hey there!\n\nWhen you registered your ticket, you answered 'Yes' to the question 'Do you have a life-threatening allergy that would affect your experience at WordCamp?' If you made the choice by mistake, you can edit the ticket information from:\n\n[ticket_url]\n\nIf you do have a life-threatening allergy, 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__ . '\Allergy_Field' );