Preprocess transactional email newsletter

[MAILPOET-2286]
This commit is contained in:
Amine Ben hammou
2019-11-14 19:38:47 +01:00
committed by Jack Kitterhing
parent f56ced0ef5
commit e1a8883935
5 changed files with 96 additions and 18 deletions

View File

@@ -3,28 +3,26 @@
namespace MailPoet\Newsletter\Editor;
class LayoutHelper {
static function row($blocks) {
static function row($blocks, $styles = []) {
if (empty($styles['backgroundColor'])) {
$styles['backgroundColor'] = 'transparent';
}
return [
'type' => 'container',
'orientation' => 'horizontal',
'styles' => [
'block' => [
'backgroundColor' => 'transparent',
],
],
'styles' => ['block' => $styles],
'blocks' => $blocks,
];
}
static function col($blocks) {
static function col($blocks, $styles = []) {
if (empty($styles['backgroundColor'])) {
$styles['backgroundColor'] = 'transparent';
}
return [
'type' => 'container',
'orientation' => 'vertical',
'styles' => [
'block' => [
'backgroundColor' => 'transparent',
],
],
'styles' => ['block' => $styles],
'blocks' => $blocks,
];
}