diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e2015e13f..637b63550 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -72,6 +72,7 @@ - add: Password recovery can now be based on profile fields or simply by the user's e-mail address. - add: Button in Collaboration Systems for managing CS subscription group. + - fix: relative links sent out in emails don't work properly 7.3.21 - fix: Self-deactivation doesn't show login screen after success diff --git a/lib/WebGUI/Mail/Send.pm b/lib/WebGUI/Mail/Send.pm index 634db8403..67ec92a75 100644 --- a/lib/WebGUI/Mail/Send.pm +++ b/lib/WebGUI/Mail/Send.pm @@ -131,6 +131,38 @@ A string of HTML. =cut sub addHtml { + my $self = shift; + my $text = shift; + if ($text !~ /<(?:html|body)/) { + my $site = $self->session->url->getSiteURL; + $text = < + + + + +$text + + +END_HTML + } + $self->addHtmlRaw($text); +} + + +#------------------------------------------------------------------- + +=head2 addHtmlRaw ( html ) + +Appends an HTML block to the message without wrapping in a document. + +=head3 html + +A string of HTML. + +=cut + +sub addHtmlRaw { my $self = shift; my $text = shift; $self->{_message}->attach(