diff --git a/src/MDMailFormat.php b/src/MDMailFormat.php
index e3c5c9c..21c70d6 100644
--- a/src/MDMailFormat.php
+++ b/src/MDMailFormat.php
@@ -16,6 +16,8 @@ final class MDMailFormat {
const CSS_H2 = "margin: .3em 0 .5em 0; padding: 0 0 0 0; font-size: 1.1em; font-weight: bold;";
const CSS_P = "margin: 0 0 0 0; padding: .4em 0 .6em 0; font-style: normal;";
const CSS_FOOTER = "margin-top: .5em; padding-top: .5em; border-top: .1em solid #D6D6D6;";
+ const CSS_UL = "margin: 1em 0; padding: 0 0 0 1em; list-style: square;";
+ const CSS_OL = "margin: 1em 0; padding: 0 0 0 1em;";
const CSS_A_NORMAL = "text-decoration: none;";
const CSS_A_FOOTER = "text-decoration: none; font-size: .95em;";
const CSS_A_FOOTER_HOVER = "color: " . self::ACCENT_COLOR_SEC . " !important;";
@@ -42,6 +44,8 @@ final class MDMailFormat {
*/
public function appendHeadline(string $input):void {
+ $input = trim($input);
+
$this->_msg_html .= "
" . nl2br($input) . "
";
$this->_msg_plain .= "{$input}
===================
@@ -58,6 +62,8 @@ final class MDMailFormat {
*/
public function appendHeadlineSec(string $input):void {
+ $input = trim($input);
+
$this->_msg_html .= "" . nl2br($input) . "
";
$this->_msg_plain .= "{$input}
-------------------
@@ -74,6 +80,8 @@ final class MDMailFormat {
*/
public function appendParagraph(string $input):void {
+ $input = trim($input);
+
$this->_msg_html .= "" . nl2br($input) . "
";
$this->_msg_plain .= "
{$input}
@@ -91,6 +99,8 @@ final class MDMailFormat {
*/
public function appendButton(string $href, string $input):void {
+ $input = trim($input);
+
$this->_msg_html .= "" . nl2br($input) . "";
$this->_msg_plain .= "
{$input}: {$href}
@@ -108,6 +118,8 @@ final class MDMailFormat {
*/
public function appendLink(string $href, string $input):void {
+ $input = trim($input);
+
$this->_msg_html .= "" . nl2br($input) . "";
$this->_msg_plain .= "{$input}: {$href}";
@@ -119,7 +131,7 @@ final class MDMailFormat {
* @return void
*/
public function startUl():void {
- $this->_msg_html .= "";
+ $this->_msg_html .= "";
$this->_msg_plain .= PHP_EOL;
}
@@ -141,7 +153,7 @@ final class MDMailFormat {
* @return void
*/
public function startOl():void {
- $this->_msg_html .= "";
+ $this->_msg_html .= "";
$this->_msg_plain .= PHP_EOL;
}
@@ -157,6 +169,22 @@ final class MDMailFormat {
}
+ /**
+ * Function for appending a list item in an unordered list.
+ *
+ * @param string $input Input text.
+ *
+ * @return void
+ */
+ public function appendLiUl(string $input):void {
+
+ $input = trim($input);
+
+ $this->_msg_html .= "- {$input}
";
+ $this->_msg_plain .= PHP_EOL . "- {$input}";
+
+ }
+
/**
* Function for starting a list item in an unordered list.
*
@@ -191,6 +219,31 @@ final class MDMailFormat {
}
+ /**
+ * Function for horizontal rule.
+ *
+ * @return void
+ */
+ public function appendHr():void {
+ $this->_msg_html .= "
";
+ $this->_msg_plain .= PHP_EOL . "----------" . PHP_EOL;
+
+ }
+
+ /**
+ * Function for appending simple text.
+ *
+ * @param string $input Input text.
+ *
+ * @return void
+ */
+ public function appendInlineText(string $input):void {
+ $input = trim($input);
+ $this->_msg_html .= $input . " ";
+ $this->_msg_plain .= $input . " ";
+
+ }
+
// Getters
/**
@@ -212,6 +265,8 @@ final class MDMailFormat {
a.buttonLike { ' . self::CSS_A_BUTTONLIKE . ' }
a.buttonLike:hover { ' . self::CSS_A_BUTTONLIKE_HOVER . ' }
p { ' . self::CSS_P . ' }
+ ul { ' . self::CSS_UL . ' }
+ ol { ' . self::CSS_OL . ' }
#footer { ' . self::CSS_FOOTER . ' }
#footer a { ' . self::CSS_A_FOOTER . ' }
#footer a:hover { ' . self::CSS_A_FOOTER_HOVER . ' }