Refactor email content styles from string to array
[MAILPOET-5591]
This commit is contained in:
@@ -25,20 +25,46 @@ class StylesController {
|
||||
* Default styles applied to the email. These are going to be replaced by style settings.
|
||||
* This is currently more af a proof of concept that we can apply styles to the email.
|
||||
* We will gradually replace these hardcoded values with styles saved as global styles or styles saved with the email.
|
||||
* @var string
|
||||
* @var array
|
||||
*/
|
||||
const DEFAULT_EMAIL_CONTENT_STYLES = "
|
||||
body { font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; }
|
||||
p { font-size: 16px; }
|
||||
h1 { font-size: 32px; }
|
||||
h2 { font-size: 24px; }
|
||||
h3 { font-size: 18px; }
|
||||
h4 { font-size: 16px; }
|
||||
h5 { font-size: 14px; }
|
||||
h6 { font-size: 12px; }
|
||||
";
|
||||
const DEFAULT_EMAIL_CONTENT_STYLES = [
|
||||
'typography' => [
|
||||
'fontFamily' => "Arial, 'Helvetica Neue', Helvetica, sans-serif",
|
||||
'fontSize' => '16px',
|
||||
],
|
||||
'h1' => [
|
||||
'typography' => [
|
||||
'fontSize' => '32px',
|
||||
],
|
||||
],
|
||||
'h2' => [
|
||||
'typography' => [
|
||||
'fontSize' => '24px',
|
||||
],
|
||||
],
|
||||
'h3' => [
|
||||
'typography' => [
|
||||
'fontSize' => '18px',
|
||||
],
|
||||
],
|
||||
'h4' => [
|
||||
'typography' => [
|
||||
'fontSize' => '16px',
|
||||
],
|
||||
],
|
||||
'h5' => [
|
||||
'typography' => [
|
||||
'fontSize' => '14px',
|
||||
],
|
||||
],
|
||||
'h6' => [
|
||||
'typography' => [
|
||||
'fontSize' => '12px',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
public function getEmailContentStyles(): string {
|
||||
public function getEmailContentStyles(): array {
|
||||
return self::DEFAULT_EMAIL_CONTENT_STYLES;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user