$message->setSubject($subject);
$message->setPlainBody($emailTemplate->renderText());
- $message->setHtmlBody($emailTemplate->renderHTML());
+ $message->setHtmlBody($emailTemplate->renderHtml());
$this->mailer->send($message);
}
$message->setTo([$shareWith]);
$message->setSubject($subject);
$message->setBody($emailTemplate->renderText(), 'text/plain');
- $message->setHtmlBody($emailTemplate->renderHTML());
+ $message->setHtmlBody($emailTemplate->renderHtml());
$this->mailer->send($message);
}
->with('Text Render');
$template
->expects($this->once())
- ->method('renderHTML')
+ ->method('renderHtml')
->willReturn('HTML Render');
$message
->expects($this->once())
->with('Text Render');
$template
->expects($this->once())
- ->method('renderHTML')
+ ->method('renderHtml')
->willReturn('HTML Render');
$message
->expects($this->once())
$message->setTo([$email => $user->getUID()]);
$message->setSubject($this->l10n->t('%s password reset', [$this->defaults->getName()]));
$message->setPlainBody($emailTemplate->renderText());
- $message->setHtmlBody($emailTemplate->renderHTML());
+ $message->setHtmlBody($emailTemplate->renderHtml());
$message->setFrom([$this->from => $this->defaults->getName()]);
$this->mailer->send($message);
} catch (\Exception $e) {
* Class EMailTemplate
*
* addBodyText and addBodyButtonGroup automatically opens the body
- * addFooter, renderHTML, renderText automatically closes the body and the HTML if opened
+ * addFooter, renderHtml, renderText automatically closes the body and the HTML if opened
*
* @package OC\Mail
*/
*
* @return string
*/
- public function renderHTML() {
+ public function renderHtml() {
if (!$this->footerAdded) {
$this->footerAdded = true;
if ($this->bodyOpened) {
*
* $emailTemplate->addFooter('Optional footer text');
*
- * $htmlContent = $emailTemplate->renderHTML();
+ * $htmlContent = $emailTemplate->renderHtml();
* $plainContent = $emailTemplate->renderText();
*
* @since 12.0.0
*
* @since 12.0.0
*/
- public function renderHTML();
+ public function renderHtml();
/**
* Returns the rendered plain text email as string
$message = $this->mailer->createMessage();
$message->setTo([$email => $displayName]);
$message->setSubject($this->l10n->t('Email setting test'));
- $message->setHtmlBody($template->renderHTML());
+ $message->setHtmlBody($template->renderHtml());
$message->setPlainBody($template->renderText());
$errors = $this->mailer->send($message);
if (!empty($errors)) {
$message->setTo([$user->getEMailAddress() => $user->getDisplayName()]);
$message->setSubject($this->l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl]));
$message->setBody($template->renderText(), 'text/plain');
- $message->setHtmlBody($template->renderHTML());
+ $message->setHtmlBody($template->renderHtml());
$this->mailer->send($message);
}
$message->setTo([$oldMailAddress => $user->getDisplayName()]);
$message->setSubject($this->l->t('Email address for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl]));
$message->setBody($template->renderText(), 'text/plain');
- $message->setHtmlBody($template->renderHTML());
+ $message->setHtmlBody($template->renderHtml());
$this->mailer->send($message);
}
$message = $this->mailer->createMessage();
$message->setTo([$user->getEMailAddress() => $user->getDisplayName()]);
$message->setSubject($this->l10n->t('Your %s account was created', [$this->themingDefaults->getName()]));
- $message->setHtmlBody($emailTemplate->renderHTML());
+ $message->setHtmlBody($emailTemplate->renderHtml());
$message->setPlainBody($emailTemplate->renderText());
$message->setFrom([$this->fromAddress => $this->themingDefaults->getName()]);
$this->mailer->send($message);
->with(['lostpassword-noreply@localhost' => null]);
$emailTemplate = $this->createMock(IEMailTemplate::class);
$emailTemplate->expects($this->any())
- ->method('renderHTML')
+ ->method('renderHtml')
->willReturn('HTML body');
$emailTemplate->expects($this->any())
->method('renderText')
->with(['lostpassword-noreply@localhost' => null]);
$emailTemplate = $this->createMock(IEMailTemplate::class);
$emailTemplate->expects($this->any())
- ->method('renderHTML')
+ ->method('renderHtml')
->willReturn('HTML body');
$emailTemplate->expects($this->any())
->method('renderText')
->with(['lostpassword-noreply@localhost' => null]);
$emailTemplate = $this->createMock(IEMailTemplate::class);
$emailTemplate->expects($this->any())
- ->method('renderHTML')
+ ->method('renderHtml')
->willReturn('HTML body');
$emailTemplate->expects($this->any())
->method('renderText')
EOF;
$result = $this->newUserMailHelper->generateTemplate($user, true);
- $this->assertEquals($expectedHtmlBody, $result->renderHTML());
+ $this->assertEquals($expectedHtmlBody, $result->renderHtml());
$this->assertEquals($expectedTextBody, $result->renderText());
$this->assertSame('OC\Mail\EMailTemplate', get_class($result));
}
EOF;
$result = $this->newUserMailHelper->generateTemplate($user, false);
- $this->assertEquals($expectedHtmlBody, $result->renderHTML());
+ $this->assertEquals($expectedHtmlBody, $result->renderHtml());
$this->assertEquals($expectedTextBody, $result->renderText());
$this->assertSame('OC\Mail\EMailTemplate', get_class($result));
}
$message
->expects($this->at(2))
->method('setHtmlBody')
- ->with($emailTemplate->renderHTML());
+ ->with($emailTemplate->renderHtml());
$message
->expects($this->at(3))
->method('setPlainBody')
);
$expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email.html');
- $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML());
+ $this->assertSame($expectedHTML, $this->emailTemplate->renderHtml());
$expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email.txt');
$this->assertSame($expectedTXT, $this->emailTemplate->renderText());
}
$this->emailTemplate->addFooter();
$expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.html');
- $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML());
+ $this->assertSame($expectedHTML, $this->emailTemplate->renderHtml());
$expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.txt');
$this->assertSame($expectedTXT, $this->emailTemplate->renderText());
}
$this->emailTemplate->addFooter();
$expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-single-button.html');
- $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML());
+ $this->assertSame($expectedHTML, $this->emailTemplate->renderHtml());
$expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-single-button.txt');
$this->assertSame($expectedTXT, $this->emailTemplate->renderText());
}
$this->emailTemplate->addFooter();
$expectedHTML = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom.html');
- $this->assertSame($expectedHTML, $this->emailTemplate->renderHTML());
+ $this->assertSame($expectedHTML, $this->emailTemplate->renderHtml());
$expectedTXT = file_get_contents(\OC::$SERVERROOT . '/tests/data/emails/new-account-email-custom-text-alternative.txt');
$this->assertSame($expectedTXT, $this->emailTemplate->renderText());
}