public setButton ( string $url, string $text, string $textColor = '', string $backgroundColor = '' ) : EmailTemplate | ||
$url | string | The href value of the button. |
$text | string | The button text. |
$textColor | string | The hex color code of the button text, must include the leading '#'. |
$backgroundColor | string | The hex color code of the button background, must include the leading '#'. |
return | EmailTemplate | $this The calling object. |
public function setButton($url, $text, $textColor = '', $backgroundColor = '')
{
if (!$textColor) {
$textColor = $this->defaultButtonTextColor;
}
if (!$backgroundColor) {
$backgroundColor = $this->defaultButtonBackgroundColor;
}
$this->button = array('url' => htmlspecialchars($url), 'text' => htmlspecialchars($this->formatContent($text)), 'textColor' => htmlspecialchars($textColor), 'backgroundColor' => htmlspecialchars($backgroundColor));
return $this;
}