PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.2.1
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.2.1
2.2.1 2.2.0 2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 All 44 releases
fluent-boards / app / Views / emails / subtask-reminder.php

subtask-reminder.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 2.2.1, at app/Views/emails/subtask-reminder.php

77 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('ABSPATH')) exit; // if accessed directly exit
2 /**
3 * Task and subtask reminder email (sent by Fluent Boards Pro).
4 *
5 * @var object $task Task or subtask being reminded about
6 * @var object $parent_task Parent task (the task itself for top-level tasks)
7 * @var object $board
8 * @var string $stage Stage title
9 * @var string $task_url
10 * @var object $user Recipient (optional; older senders omit it)
11 */
12
13 $fluent_boards_is_subtask = !empty($task->parent_id);
14
15 // Resolve a safe recipient name to avoid a broken greeting when $user is missing.
16 $fluent_boards_recipient_name = '';
17 if (isset($user) && is_object($user)) {
18 foreach (['display_name', 'user_nicename', 'user_login'] as $fluent_boards_name_field) {
19 if (!empty($user->{$fluent_boards_name_field})) {
20 $fluent_boards_recipient_name = $user->{$fluent_boards_name_field};
21 break;
22 }
23 }
24 }
25
26 if ($fluent_boards_recipient_name) {
27 $heading = $fluent_boards_is_subtask
28 /* translators: %s is the recipient's name */
29 ? sprintf(__('Hi %s, a subtask is due soon', 'fluent-boards'), $fluent_boards_recipient_name)
30 /* translators: %s is the recipient's name */
31 : sprintf(__('Hi %s, a task is due soon', 'fluent-boards'), $fluent_boards_recipient_name);
32 } else {
33 $heading = $fluent_boards_is_subtask
34 ? __('A subtask is due soon', 'fluent-boards')
35 : __('A task is due soon', 'fluent-boards');
36 }
37
38 $badge = [
39 'label' => __('Reminder', 'fluent-boards'),
40 'tone' => 'warn',
41 ];
42
43 $fluent_boards_rows = [
44 [__('Board', 'fluent-boards'), esc_html($board->title)],
45 ];
46 if (!empty($stage)) {
47 $fluent_boards_rows[] = [__('Stage', 'fluent-boards'), esc_html($stage)];
48 }
49 if (!empty($task->due_at)) {
50 $fluent_boards_rows[] = [
51 __('Due', 'fluent-boards'),
52 '<strong class="fbs_email_warn_text" style="color: #7A4D00;">' . esc_html(date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($task->due_at))) . '</strong>',
53 ];
54 }
55
56 $task_card = [
57 'title' => $task->title,
58 'parent_title' => ($fluent_boards_is_subtask && !empty($parent_task)) ? $parent_task->title : '',
59 'parent_url' => $fluent_boards_is_subtask ? $task_url : '',
60 'rows' => $fluent_boards_rows,
61 'description' => !empty($task->description) ? wp_trim_words($task->description, 30) : '',
62 ];
63
64 $cta = [
65 'label' => $fluent_boards_is_subtask ? __('Open subtask', 'fluent-boards') : __('Open task', 'fluent-boards'),
66 'url' => $task_url,
67 ];
68
69 if (empty($email_reason)) {
70 $email_reason = __('You’re getting this because you’re assigned and reminders are on.', 'fluent-boards');
71 }
72
73 // The sender's $body repeats the heading; the structured card replaces it.
74 $body = '';
75
76 include __DIR__ . '/notification.php';
77