aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-04-13 20:02:15 +0200
committerGitHub <noreply@github.com>2017-04-13 20:02:15 +0200
commit81d3732bf51590ca3e3b8abc794d9562346862f5 (patch)
tree0c31d0bd84d07461cb3b439ed256be7f6dc3596c /lib
parentd36751ee38ee3c9994ac6f2e44313b29d893d2f7 (diff)
parent1f962f91154b04c5ec49df14a3e0aa2f4905e1c6 (diff)
downloadnextcloud-server-81d3732bf51590ca3e3b8abc794d9562346862f5.tar.gz
nextcloud-server-81d3732bf51590ca3e3b8abc794d9562346862f5.zip
Merge pull request #4308 from nextcloud/lost-password-email
Update email template for lost password email
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Mail/EMailTemplate.php15
-rw-r--r--lib/public/Mail/IEMailTemplate.php4
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php
index 805126d2ad8..c0949b91c42 100644
--- a/lib/private/Mail/EMailTemplate.php
+++ b/lib/private/Mail/EMailTemplate.php
@@ -423,10 +423,12 @@ EOF;
*
* @param string $text Text of button
* @param string $url URL of button
+ * @param string $plainText Text of button in plain text version
+ * if empty the $text is used, if false none will be used
*
* @since 12.0.0
*/
- public function addBodyButton($text, $url) {
+ public function addBodyButton($text, $url, $plainText = '') {
if ($this->footerAdded) {
return;
}
@@ -436,9 +438,18 @@ EOF;
$this->bodyOpened = true;
}
+ if ($plainText === '') {
+ $plainText = $text;
+ }
+
$color = $this->themingDefaults->getColorPrimary();
$this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, htmlspecialchars($text)]);
- $this->plainBody .= $text . ': ' . $url . PHP_EOL;
+
+ if ($plainText !== false) {
+ $this->plainBody .= $plainText . ': ';
+ }
+
+ $this->plainBody .= $url . PHP_EOL;
}
diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php
index 4e308509c42..41daacdb49f 100644
--- a/lib/public/Mail/IEMailTemplate.php
+++ b/lib/public/Mail/IEMailTemplate.php
@@ -99,10 +99,12 @@ interface IEMailTemplate {
*
* @param string $text Text of button
* @param string $url URL of button
+ * @param string $plainText Text of button in plain text version
+ * if empty the $text is used, if false none will be used
*
* @since 12.0.0
*/
- public function addBodyButton($text, $url);
+ public function addBodyButton($text, $url, $plainText = '');
/**
* Adds a logo and a text to the footer. <br> in the text will be replaced by new lines in the plain text email