| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for stats email |
| 4 |
* |
| 5 |
* @since 6.7 |
| 6 |
* @package Formidable |
| 7 |
* |
| 8 |
* @var array $args Content args. |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
die( 'You are not allowed to call this page directly.' ); |
| 13 |
} |
| 14 |
?> |
| 15 |
|
| 16 |
<div style="padding-top: 1.375em;"> |
| 17 |
<!-- Header section --> |
| 18 |
<div style="<?php echo esc_attr( FrmEmailSummaryHelper::get_section_style( '' ) ); ?>"> |
| 19 |
<h1 style="font-size: 2.5em; line-height: 1.2em; margin: 0 0 32px;"><?php echo esc_html( $args['subject'] ); ?></h1> |
| 20 |
|
| 21 |
<div style="line-height: 1.5; color: #475467;"> |
| 22 |
<?php echo esc_html( FrmAppHelper::get_formatted_time( $args['from_date'] ) ); ?> - <?php echo esc_html( FrmAppHelper::get_formatted_time( $args['to_date'] ) ); ?> · <a style="color: #475467;" href="<?php echo esc_url( $args['site_url'] ); ?>" title=""><?php echo esc_url( $args['site_url_display'] ); ?></a> |
| 23 |
</div> |
| 24 |
</div> |
| 25 |
|
| 26 |
<!-- Overall section --> |
| 27 |
<div style="<?php echo esc_attr( FrmEmailSummaryHelper::get_section_style() ); ?>"> |
| 28 |
<?php FrmEmailSummaryHelper::section_heading_with_icon( 'chart', __( 'Statistics', 'formidable' ) ); ?> |
| 29 |
|
| 30 |
<table width="100%" cellspacing="0" cellpadding="0"> |
| 31 |
<tr> |
| 32 |
<?php |
| 33 |
foreach ( $args['stats'] as $stat ) { |
| 34 |
?> |
| 35 |
<td style="padding:0 0.375em;"> |
| 36 |
<div style="line-height: 1.5; margin-bottom: 0.375em;"><?php echo esc_html( $stat['label'] ); ?></div> |
| 37 |
<div> |
| 38 |
<strong style="font-size: 1.5em; line-height: 1; vertical-align: text-top;"> |
| 39 |
<?php echo isset( $stat['display'] ) ? esc_html( $stat['display'] ) : intval( $stat['count'] ); ?> |
| 40 |
</strong> |
| 41 |
<?php FrmEmailSummaryHelper::show_comparison( $stat['compare'] ); ?> |
| 42 |
</div> |
| 43 |
</td> |
| 44 |
<?php |
| 45 |
} |
| 46 |
?> |
| 47 |
</tr> |
| 48 |
</table> |
| 49 |
|
| 50 |
<?php if ( ! empty( $args['dashboard_url'] ) ) : ?> |
| 51 |
<a |
| 52 |
href="<?php echo esc_url( $args['dashboard_url'] ); ?>" |
| 53 |
style="<?php echo esc_attr( FrmEmailSummaryHelper::get_button_style( true ) ); ?>" |
| 54 |
><?php esc_html_e( 'Open Dashboard', 'formidable' ); ?></a> |
| 55 |
<?php endif; ?> |
| 56 |
</div> |
| 57 |
|
| 58 |
<?php if ( $args['top_forms'] ) : ?> |
| 59 |
<!-- Top forms section --> |
| 60 |
<div style="<?php echo esc_attr( FrmEmailSummaryHelper::get_section_style() ); ?>"> |
| 61 |
<?php FrmEmailSummaryHelper::section_heading_with_icon( 'trophy', $args['top_forms_label'] ); ?> |
| 62 |
|
| 63 |
<table width="100%" cellspacing="0" cellpadding="0"> |
| 64 |
<tr style="font-size: 0.75em; font-weight: 500; line-height: 2; text-transform: uppercase;"> |
| 65 |
<th align="left" style=""><?php esc_html_e( 'Form name', 'formidable' ); ?></th> |
| 66 |
<th align="right" style=""><?php esc_html_e( 'Submissions', 'formidable' ); ?></th> |
| 67 |
</tr> |
| 68 |
|
| 69 |
<?php |
| 70 |
foreach ( $args['top_forms'] as $index => $top_form ) { |
| 71 |
?> |
| 72 |
<tr> |
| 73 |
<td align="left" style="padding: 1em 0.33em 0.28em 0"><?php echo intval( $index + 1 ); ?>. <?php echo esc_html( $top_form->form_name ); ?></td> |
| 74 |
<td align="right" style="padding: 1em 0 0.28em;"><?php echo intval( $top_form->items_count ); ?></td> |
| 75 |
</tr> |
| 76 |
<?php |
| 77 |
} |
| 78 |
?> |
| 79 |
</table> |
| 80 |
</div> |
| 81 |
<?php endif; ?> |
| 82 |
|
| 83 |
<?php if ( ! empty( $args['inbox_msg'] ) ) : ?> |
| 84 |
<!-- Inbox notice section --> |
| 85 |
<div style="<?php echo esc_attr( FrmEmailSummaryHelper::get_section_style() ); ?>"> |
| 86 |
<?php FrmEmailSummaryHelper::section_heading_with_icon( 'speaker', $args['inbox_msg']['subject'] ); ?> |
| 87 |
|
| 88 |
<div style="line-height: 1.5;"> |
| 89 |
<?php echo wp_kses_post( wpautop( $args['inbox_msg']['message'] ) ); ?> |
| 90 |
</div> |
| 91 |
|
| 92 |
<?php if ( ! empty( $args['inbox_msg']['cta'] ) ) : ?> |
| 93 |
<p> |
| 94 |
<?php echo wp_kses_post( FrmEmailSummaryHelper::process_inbox_cta_button( $args['inbox_msg']['cta'] ) ); ?> |
| 95 |
</p> |
| 96 |
<?php endif; ?> |
| 97 |
</div> |
| 98 |
<?php endif; ?> |
| 99 |
|
| 100 |
<?php if ( ! empty( $args['out_of_date_plugins'] ) ) : ?> |
| 101 |
<div style="<?php echo esc_attr( FrmEmailSummaryHelper::get_section_style() ); ?>"> |
| 102 |
<?php FrmEmailSummaryHelper::section_heading_with_icon( 'notice', __( 'Out of date plugins', 'formidable' ) ); ?> |
| 103 |
|
| 104 |
<p style="line-height: 1.5;"> |
| 105 |
<?php |
| 106 |
printf( |
| 107 |
// translators: the list of out-of-date plugins. |
| 108 |
esc_html__( 'The following plugins are out of date: %s', 'formidable' ), |
| 109 |
'<span style="font-style: italic;">' . esc_html( implode( ', ', $args['out_of_date_plugins'] ) ) . '</span>' |
| 110 |
); |
| 111 |
?> |
| 112 |
</p> |
| 113 |
|
| 114 |
<a |
| 115 |
href="<?php echo esc_url( $args['plugins_url'] ); ?>" |
| 116 |
style="<?php echo esc_attr( FrmEmailSummaryHelper::get_button_style( true ) ); ?>" |
| 117 |
><?php esc_html_e( 'Update', 'formidable' ); ?></a> |
| 118 |
</div> |
| 119 |
<?php endif; ?> |
| 120 |
</div> |
| 121 |
|