| 1 |
<?php // phpcs:ignore Squiz.Commenting.FileComment.Missing -- File doc comment exists |
| 2 |
/** |
| 3 |
* Analytify Email Render Trait |
| 4 |
* |
| 5 |
* This trait contains all the UI rendering functionality for the Analytify Email system. |
| 6 |
* It was created to separate display logic from other email operations, keeping the code |
| 7 |
* organized and maintainable. |
| 8 |
* |
| 9 |
* PURPOSE: |
| 10 |
* - Handles UI rendering and display elements |
| 11 |
* - Manages single post email button display |
| 12 |
* - Provides email interface components |
| 13 |
* - Handles visual email elements and forms |
| 14 |
* |
| 15 |
* @package WP_Analytify |
| 16 |
* @subpackage Email |
| 17 |
* @since 8.0.0 |
| 18 |
*/ |
| 19 |
|
| 20 |
trait Analytify_Email_Render { |
| 21 |
|
| 22 |
/** |
| 23 |
* Show Send Email button on Single Page/Post. |
| 24 |
* |
| 25 |
* @since 1.2.0 |
| 26 |
* @return void |
| 27 |
*/ |
| 28 |
public function single_send_email() { |
| 29 |
echo '<div class="analytify-single-mail-submit"> |
| 30 |
<input type="submit" value="' . esc_attr__( 'Send Email Report', 'wp-analytify' ) . '" name="send_email" class="analytify_submit_date_btn" id="send_single_analytics">'; |
| 31 |
|
| 32 |
// phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.Found -- Assignment in condition is intentional |
| 33 |
if ( apply_filters( 'wpa_display_email_single_input_field', $display = false ) ) { |
| 34 |
echo '<input type="email" name="recipient_email" placeholder="' . esc_attr__( 'Enter Recipient Email', 'wp-analytify' ) . '" id="recipient_email" style="min-height: 46px; min-width: 250px; margin-left: 4px;">'; |
| 35 |
} |
| 36 |
|
| 37 |
echo '<span style=\'min-height:30px;min-width:150px;display:none\' class=\'send_email stats_loading\'></span></div>'; |
| 38 |
} |
| 39 |
} |
| 40 |
|