← All changes
|
includes/admin/emails/class-email-setting-field.php
+26
-19
2.3.1
→
4.17.0
View file →
| @@ -171,9 +171,9 @@ | ||
| 171 | 171 | |
| 172 | 172 | // Add global options. |
| 173 | 173 | if ( $form_id || give_is_add_new_form_page() ) { |
| 174 | 174 | $option = array( |
| 175 | - 'global' => __( 'Global Options' ), | |
| 175 | + 'global' => __( 'Global Options', 'give' ), | |
| 176 | 176 | 'enabled' => __( 'Customize', 'give' ), |
| 177 | 177 | 'disabled' => __( 'Disabled', 'give' ), |
| 178 | 178 | ); |
| 179 | 179 | |
| @@ -179,9 +179,9 @@ | ||
| 179 | 179 | |
| 180 | 180 | $default_value = 'global'; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $description = isset( $_GET['page'] ) && 'give-settings' === $_GET['page'] ? __( 'Choose whether you want this email enabled or not.', 'give' ) : sprintf( __( 'Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) ); | |
| 183 | + $description = isset( $_GET['page'] ) && 'give-settings' === $_GET['page'] ? __( 'Choose whether you want this email enabled or not.', 'give' ) : sprintf( __( 'Global Options are set <a href="%s">in GiveWP settings</a>. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) ); | |
| 184 | 184 | |
| 185 | 185 | return array( |
| 186 | 186 | 'name' => esc_html__( 'Notification', 'give' ), |
| 187 | 187 | 'desc' => $description, |
| @@ -249,17 +249,16 @@ | ||
| 249 | 249 | $desc = esc_html__( 'Enter the email message.', 'give' ); |
| 250 | 250 | |
| 251 | 251 | if ( $email_tag_list = $email->get_allowed_email_tags( true ) ) { |
| 252 | 252 | $desc = sprintf( |
| 253 | - '%1$s <br> %2$s: %3$s %4$s', | |
| 254 | - __( 'The email that is sent to users after completing a successful donation. HTML is accepted.', 'give' ), | |
| 255 | - __( 'Available template tags', 'give' ), | |
| 253 | + '%1$s <br> %2$s %3$s', | |
| 254 | + __( 'Available template tags for this email. HTML is accepted.', 'give' ), | |
| 256 | 255 | $email_tag_list, |
| 257 | 256 | sprintf( |
| 258 | 257 | '<br><a href="%1$s" target="_blank">%2$s</a> %3$s', |
| 259 | 258 | esc_url( 'http://docs.givewp.com/meta-email-tags' ), |
| 260 | 259 | __( 'See our documentation', 'give' ), |
| 261 | - __( 'for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give' ) | |
| 260 | + __( 'for examples of how to use custom meta email tags to output additional donor or donation information in your GiveWP emails.', 'give' ) | |
| 262 | 261 | ) |
| 263 | 262 | ); |
| 264 | 263 | |
| 265 | 264 | } |
| @@ -345,21 +344,25 @@ | ||
| 345 | 344 | |
| 346 | 345 | // Disable field if email donor has recipient field. |
| 347 | 346 | // @see https://github.com/impress-org/give/issues/2657 |
| 348 | 347 | if ( ! $edit_recipient ) { |
| 349 | - if ( 'group' == $recipient['type'] ) { | |
| 350 | - $recipient = current( $recipient['fields'] ); | |
| 351 | - $recipient['type'] = 'text'; | |
| 352 | - } | |
| 348 | + if ('group' == $recipient['type']) { | |
| 349 | + $recipient = current($recipient['fields']); | |
| 350 | + $recipient['type'] = 'text'; | |
| 351 | + } | |
| 353 | 352 | |
| 354 | - $recipient['attributes']['disabled'] = 'disabled'; | |
| 355 | - $recipient['value'] = $recipient['default'] = '{donor_email}'; | |
| 356 | - $recipient['repeat'] = false; | |
| 357 | - $recipient['desc'] = __( 'This email is automatically sent to the donor and the recipient cannot be customized.', 'give' ); | |
| 358 | - } | |
| 353 | + $recipient['attributes']['disabled'] = 'disabled'; | |
| 354 | + $recipient['value'] = $recipient['default'] = '{donor_email}'; | |
| 355 | + $recipient['repeat'] = false; | |
| 356 | + $recipient['desc'] = __('This email is automatically sent to the donor and the recipient cannot be customized.', | |
| 357 | + 'give'); | |
| 358 | + } | |
| 359 | 359 | |
| 360 | - return $recipient; | |
| 361 | - } | |
| 360 | + /** | |
| 361 | + * @since 2.23.0 | |
| 362 | + */ | |
| 363 | + return apply_filters('give_get_recipient_setting_field', $recipient, $email, $form_id, $edit_recipient); | |
| 364 | + } | |
| 362 | 365 | |
| 363 | 366 | /** |
| 364 | 367 | * Get preview setting field. |
| 365 | 368 | * |
| @@ -373,10 +376,14 @@ | ||
| 373 | 376 | */ |
| 374 | 377 | public static function get_preview_setting_field( Give_Email_Notification $email, $form_id = null ) { |
| 375 | 378 | return array( |
| 376 | 379 | 'name' => __( 'Preview Email', 'give' ), |
| 377 | - 'desc' => __( 'Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.', | |
| 378 | - 'give' ), | |
| 380 | + 'desc' => sprintf( | |
| 381 | + '%1$s<br />%2$s <code>%3$s</code>.', | |
| 382 | + esc_html__( 'Click the "Preview Email" button to preview the email in your browser.', 'give' ), | |
| 383 | + esc_html__( 'Click the "Send Test Email" button to send a test email to yourself at', 'give' ), | |
| 384 | + wp_get_current_user()->user_email | |
| 385 | + ), | |
| 379 | 386 | 'id' => self::get_prefix( $email, $form_id ) . 'preview_buttons', |
| 380 | 387 | 'type' => 'email_preview_buttons', |
| 381 | 388 | ); |
| 382 | 389 | } |