| @@ -16,9 +16,19 @@ | ||
| 16 | 16 | $viewData = Arr::wrap($viewData); |
| 17 | 17 | $viewData = array_merge($viewData, [ |
| 18 | 18 | 'default_banner_image' => $defaultBannerImage, |
| 19 | 19 | ]); |
| 20 | - App::make('view')->render('emails.' . $name, $viewData); | |
| 20 | + // Core templates resolve against app/Views/emails. Add-ons register | |
| 21 | + // their own notifications but keep the templates inside their own | |
| 22 | + // plugin, where that prefix cannot reach — they match on the | |
| 23 | + // template_path they registered and return a path View::make() can | |
| 24 | + // resolve (an absolute file path is safest). Core paths are untouched. | |
| 25 | + $viewPath = apply_filters('fluent_cart/email/template_view_path', 'emails.' . $name, [ | |
| 26 | + 'template_path' => $name, | |
| 27 | + 'view_data' => $viewData, | |
| 28 | + ]); | |
| 29 | + | |
| 30 | + App::make('view')->render($viewPath, $viewData); | |
| 21 | 31 | return ob_get_clean(); |
| 22 | 32 | } |
| 23 | 33 | |
| 24 | 34 | public static function getInvoicePackingTemplateByPathName($name) |