Render Coupon block in email body
[MAILPOET-4678]
This commit is contained in:
@@ -37,6 +37,9 @@ class Renderer {
|
||||
/** @var Placeholder */
|
||||
private $placeholder;
|
||||
|
||||
/** @var Coupon */
|
||||
private $coupon;
|
||||
|
||||
public function __construct(
|
||||
AutomatedLatestContentBlock $ALC,
|
||||
Button $button,
|
||||
@@ -47,7 +50,8 @@ class Renderer {
|
||||
Social $social,
|
||||
Spacer $spacer,
|
||||
Text $text,
|
||||
Placeholder $placeholder
|
||||
Placeholder $placeholder,
|
||||
Coupon $coupon
|
||||
) {
|
||||
$this->ALC = $ALC;
|
||||
$this->button = $button;
|
||||
@@ -59,6 +63,7 @@ class Renderer {
|
||||
$this->spacer = $spacer;
|
||||
$this->text = $text;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->coupon = $coupon;
|
||||
}
|
||||
|
||||
public function render(NewsletterEntity $newsletter, $data) {
|
||||
@@ -120,6 +125,8 @@ class Renderer {
|
||||
return $this->text->render($block);
|
||||
case 'placeholder':
|
||||
return $this->placeholder->render($block);
|
||||
case Coupon::TYPE:
|
||||
return $this->coupon->render($block, $columnBaseWidth);
|
||||
}
|
||||
return "<!-- Skipped unsupported block type: {$block['type']} -->";
|
||||
}
|
||||
|
Reference in New Issue
Block a user