PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.5.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.5.5
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / views / admin / email / body.php

body.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.5.5, at views/admin/email/body.php

103 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical.
3 // phpcs:disable PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- HTML email assets must be remote.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7 $from_date = isset( $args['views']['from_date'] ) ? date( 'M j, Y', strtotime( $args['views']['from_date'] ) ) : ''; //phpcs:ignore
8 $to_date = isset( $args['views']['to_date'] ) ? date( 'M j, Y', strtotime( $args['views']['to_date'] ) ) : ''; //phpcs:ignore
9 ?>
10 <tr style="background: #26d67d">
11 <td style="padding: 20px 40px">
12 <table style="width: 100%; border-spacing: 0;">
13 <tr>
14 <td>
15 <img src="https://betterdocs.co/wp-content/uploads/2022/12/BetterDocs-logo-white.png" style="max-width: 100%; height: 35px" alt="logo" />
16 </td>
17 <td align="right">
18 <span style="font-size: 12px; line-height: 1em; text-align: right; color: #fff; flex-direction: column; column-gap: 5px;">
19 <span style="display:block; margin-bottom: 5px; font-weight: 600; font-size: 18px;">
20 <?php echo wp_sprintf( '%s %s', esc_html__( 'Last', 'betterdocs' ), esc_html( $days ) ); ?>
21 </span>
22 <span>
23 <?php
24 if ( $frequency == 'betterdocs_daily' ) {
25 echo esc_html( $from_date );
26 } else {
27 echo wp_sprintf( '%s - %s', esc_html( $from_date ), esc_html( $to_date ) );
28 }
29 ?>
30 </span>
31 </span>
32 </td>
33 </tr>
34 </table>
35 </td>
36 </tr>
37 <tr style="background: #f7f9fb"> <!-- tr table body wrapper start -->
38 <td style="padding: 50px">
39 <table cellpadding="0" cellspacing="0" border="0" align="center">
40 <tbody>
41 <tr>
42 <td style="text-align: center; font-size: 20px; font-weight: bold; padding-bottom: 40px;">
43 <?php
44 printf(
45 // translators: %s is the website name.
46 esc_html__( 'Your Documentation Performance of %s Website', 'betterdocs' ),
47 esc_html( $bloginfo )
48 );
49 ?>
50 </td>
51 </tr>
52 <?php
53 $_analytics_body = [
54 'overview' => function () use ( $frequency, $args, $report_email ) {
55 betterdocs()->views->get(
56 'admin/email/analytics/overview',
57 [
58 'frequency' => $frequency,
59 'args' => $args,
60 'report_email' => $report_email
61 ]
62 );
63 },
64 'leading-docs' => function () use ( $frequency, $args ) {
65 betterdocs()->views->get(
66 'admin/email/analytics/leading-docs',
67 [
68 'frequency' => $frequency,
69 'args' => $args['docs']['current_data'],
70 'total_reactions' => $args['docs']['total_current_reactions']
71 ]
72 );
73 },
74 'search-keyword' => function () use ( $frequency, $args ) {
75 betterdocs()->views->get(
76 'admin/email/analytics/search-keyword',
77 [
78 'frequency' => $frequency,
79 'keywords' => $args['search']['keywords']
80 ]
81 );
82 }
83
84 ];
85
86 $_analytics_body = apply_filters( 'betterdocs_analytics_reporting_tables', $_analytics_body, $args, $frequency, $report_email );
87
88 if ( is_array( $_analytics_body ) ) {
89 foreach ( $_analytics_body as $_analytics_func ) {
90 $_analytics_func();
91 }
92 }
93
94 betterdocs()->views->get(
95 'admin/email/pro',
96 [
97 'analytics_url' => admin_url( 'admin.php?page=betterdocs-analytics' ),
98 'is_pro' => betterdocs()->is_pro_active()
99 ]
100 );
101
102 // body is completed in admin/email/footer.
103