PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Http/Controllers/EmailNotificationController.php +8 -0 1.6.0 → 1.6.5 View file →
@@ -155,8 +155,16 @@
155 155
156 156 $previewService = new EmailPreviewService();
157 157 $data = $previewService->getPreviewData($template);
158 158
159 + // Let add-ons adjust the preview data for their own templates — e.g. unset
160 + // `order` so an orderless notification (wishlist, withdrawal, …) previews
161 + // without the order header (emails.parts.order_header renders only when
162 + // $order is non-empty), or add the sample context their smartcodes need.
163 + // Core templates are untouched: no core listener changes $data. The context
164 + // is an array so more keys can be added later without changing the signature.
165 + $data = apply_filters('fluent_cart/email/preview_data', $data, ['template' => $template]);
166 +
159 167 $body = TemplateService::getTemplateByPathName($template, $data);
160 168
161 169 // Wrap in the same outer email template used by actual emails
162 170 $header = (string) App::make('view')->make('emails.parts.order_header', $data);