Jake Vanderwerf
2026-04-15 c4aa5cdb5e90ad4b420e22772797d16980232a2b
inc/managers/EmailManager.php
@@ -756,11 +756,35 @@
      );
   }
   public function grid(array $items, int $columns = 2):string
   public function grid(array $items, int $columns = 2, string $title = '', string|array $description = '', string $after = ''):string
   {
      $width = floor(100 / $columns) - 2; // 2% gap
      $html = '<div style="display:table;width:100%;margin:20px 0;">';
      $html = '';
      if (!empty($title) || !empty($description)) {
         $html .= '<div>';
         if (!empty($title)) {
            $html .= sprintf(
               '<h2>%s</h2>',
               $title
            );
         }
         if (!empty($description)) {
            if (is_string($description)) {
               if (str_starts_with($description, '<p>')) {
                  $html .= $description;
               }else {
                  $html .= sprintf(
                     '<p>%s</p>',
                     $description
                  );
               }
            } else {
               $html .= implode('',array_map(function ($p) { return sprintf('<p>%s</p>', $p); }, $description));
            }
         }
      }
      $html .= '<div style="display:table;width:100%;margin:20px 0;">';
      foreach ($items as $index => $item) {
         if ($index > 0 && $index % $columns === 0) {
            $html .= '</div><div style="display:table;width:100%;margin:20px 0;">';
@@ -771,11 +795,16 @@
            $item
         );
      }
      $html .= '</div>';
      $html .= '</div>'.$after;
      if (!empty($title) || !empty($description)) {
         $html .= '</div>';
      }
      return $html;
   }
   public function image(string $src, string $alt = '', int $maxWidth = 600):string
   {
      return sprintf(