PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.01
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.01
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
fluent-community / app / Services / EmailDomBuilder.php

EmailDomBuilder.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 2.10.01, at app/Services/EmailDomBuilder.php

73 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCommunity\App\Services;
4
5 class EmailDomBuilder
6 {
7 protected $config = [];
8
9 protected $elements = [];
10
11 public function __construct($config = [])
12 {
13 $defaults = [
14 'font_size' => '14px',
15 'font_family' => 'Arial, Helvetica, sans-serif',
16 ];
17
18 $this->config = $config;
19 }
20
21 public function line($content, $tag = 'p')
22 {
23 $this->elements[] = [
24 'type' => 'line',
25 'tag' => $tag,
26 'content' => $content,
27 ];
28 return $this;
29 }
30
31 public function heading($content, $tag = 'h2')
32 {
33 $this->elements[] = [
34 'type' => 'heading',
35 'tag' => $tag,
36 'content' => $content,
37 ];
38 return $this;
39 }
40
41 public function button($url, $btnText, $style = 'primary')
42 {
43 $this->elements[] = [
44 'type' => 'button',
45 'content' => $btnText,
46 'url' => $url,
47 'style' => $style
48 ];
49 return $this;
50 }
51
52 public function url($url, $content)
53 {
54 $this->elements[] = [
55 'type' => 'url',
56 'content' => $content,
57 'url' => $url,
58 ];
59 return $this;
60 }
61
62 public function image($imageUrl, $alt = '')
63 {
64 $this->elements[] = [
65 'type' => 'image',
66 'content' => $imageUrl,
67 'alt' => $alt,
68 ];
69 return $this;
70 }
71
72 }
73