| 1 |
<?php |
| 2 |
/** |
| 3 |
* @var $body string |
| 4 |
* @var $pre_header string |
| 5 |
* @var $show_footer bool |
| 6 |
* @var $task object |
| 7 |
* @var $parent_task object |
| 8 |
* @var $board object |
| 9 |
* @var $task_url string |
| 10 |
* @var $site_url string |
| 11 |
* @var $site_title string |
| 12 |
* @var $site_logo string |
| 13 |
*/ |
| 14 |
|
| 15 |
ob_start(); // Start output buffering |
| 16 |
?> |
| 17 |
|
| 18 |
|
| 19 |
<div style="font-family: Arial, sans-serif; color:#333; line-height:1.5; background: #ffff !important;"> |
| 20 |
<?php |
| 21 |
// Resolve a safe recipient name to avoid broken greeting when $user is missing |
| 22 |
$fluent_boards_recipient_name = ''; |
| 23 |
if (isset($user) && is_object($user)) { |
| 24 |
$fluent_boards_recipient_name = $user->display_name ?? ''; |
| 25 |
if (!$fluent_boards_recipient_name && !empty($user->user_nicename)) { |
| 26 |
$fluent_boards_recipient_name = $user->user_nicename; |
| 27 |
} |
| 28 |
if (!$fluent_boards_recipient_name && !empty($user->user_login)) { |
| 29 |
$fluent_boards_recipient_name = $user->user_login; |
| 30 |
} |
| 31 |
} |
| 32 |
if (!$fluent_boards_recipient_name) { |
| 33 |
$fluent_boards_recipient_name = __('there', 'fluent-boards'); |
| 34 |
} |
| 35 |
?> |
| 36 |
<p style="font-size:16px; font-weight:600; margin:0 0 10px 0;background: #fff !important;"> |
| 37 |
<?php |
| 38 |
// translators: %s is the recipient's name |
| 39 |
printf(esc_html__('Hey %s,', 'fluent-boards'), esc_html($fluent_boards_recipient_name)); |
| 40 |
?> |
| 41 |
</p> |
| 42 |
|
| 43 |
<p style="margin:0 0 15px 0; font-size:14px; color:#555; background: #fff !important;"> |
| 44 |
<?php echo wp_kses_post($body); ?> |
| 45 |
</p> |
| 46 |
|
| 47 |
<div style="margin: 15px 0; padding: 15px; border:1px solid #eee; border-radius: 8px;"> |
| 48 |
<h4 style="margin: 0 0 10px 0; color: #333; font-size: 16px;"> |
| 49 |
<?php echo $task->parent_id ? esc_html__('Subtask Details:', 'fluent-boards') : esc_html__('Task Details:', 'fluent-boards'); ?> |
| 50 |
</h4> |
| 51 |
|
| 52 |
<p style="margin: 5px 0; font-size:14px;"> |
| 53 |
<strong><?php echo $task->parent_id ? esc_html__('Subtask:', 'fluent-boards') : esc_html__('Task:', 'fluent-boards'); ?></strong> |
| 54 |
<?php echo esc_html($task->title); ?> |
| 55 |
</p> |
| 56 |
|
| 57 |
<?php if ($task->parent_id && $parent_task): ?> |
| 58 |
<p style="margin: 5px 0; font-size:14px;"> |
| 59 |
<strong><?php echo esc_html__('Parent Task:', 'fluent-boards'); ?></strong> |
| 60 |
<?php echo esc_html($parent_task->title); ?> |
| 61 |
</p> |
| 62 |
<?php endif; ?> |
| 63 |
|
| 64 |
<p style="margin: 5px 0; font-size:14px;"> |
| 65 |
<strong><?php echo esc_html__('Board:', 'fluent-boards'); ?></strong> |
| 66 |
<?php echo esc_html($board->title); ?> |
| 67 |
</p> |
| 68 |
|
| 69 |
<p style="margin: 5px 0; font-size:14px;"> |
| 70 |
<strong><?php echo esc_html__('Stage:', 'fluent-boards'); ?></strong> |
| 71 |
<?php echo esc_html($stage); ?> |
| 72 |
</p> |
| 73 |
|
| 74 |
<?php if ($task->due_at): ?> |
| 75 |
<p style="margin: 5px 0; font-size:14px;"> |
| 76 |
<strong><?php echo esc_html__('Due Date:', 'fluent-boards'); ?></strong> |
| 77 |
<?php echo esc_html(gmdate('M j, Y g:i A', strtotime($task->due_at))); ?> |
| 78 |
</p> |
| 79 |
<?php endif; ?> |
| 80 |
|
| 81 |
<?php if ($task->description): ?> |
| 82 |
<p style="margin: 10px 0 5px 0; font-size:14px;"> |
| 83 |
<strong><?php echo esc_html__('Description:', 'fluent-boards'); ?></strong> |
| 84 |
</p> |
| 85 |
<div style="margin: 5px 0; padding: 10px; border-radius: 4px; font-size: 14px;"> |
| 86 |
<?php echo wp_kses_post(wp_trim_words($task->description, 30)); ?> |
| 87 |
</div> |
| 88 |
<?php endif; ?> |
| 89 |
</div> |
| 90 |
|
| 91 |
<div style="margin-top:20px; background: #fff !important;"> |
| 92 |
<a href="<?php echo esc_url($task_url); ?>" |
| 93 |
target="_blank" |
| 94 |
style="background: #6268F1; color: #FFF; padding:7px 12px; text-decoration: none; border-radius: 6px; display: inline-block; font-weight: 500; font-size:14px;"> |
| 95 |
<?php echo $task->parent_id ? esc_html__('View Subtask', 'fluent-boards') : esc_html__('View Task', 'fluent-boards'); ?> |
| 96 |
</a> |
| 97 |
</div> |
| 98 |
</div> |
| 99 |
|
| 100 |
|
| 101 |
<!--end your code here --> |
| 102 |
|
| 103 |
<?php |
| 104 |
$fluent_boards_email_content = ob_get_clean(); |
| 105 |
include 'template.php'; |
| 106 |
?> |