diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php
index da3341b6709ccaf7e807568fd966522a3d995527..e4e28a9294e777216740f4bd86ca403eccf2ebe6 100644
--- a/lib/private/Mail/EMailTemplate.php
+++ b/lib/private/Mail/EMailTemplate.php
@@ -50,6 +50,8 @@ class EMailTemplate implements IEMailTemplate {
 	/** @var array */
 	protected $data;
 
+	/** @var string */
+	protected $subject = '';
 	/** @var string */
 	protected $htmlBody = '';
 	/** @var string */
@@ -358,6 +360,15 @@ EOF;
 		$this->data = $data;
 	}
 
+	/**
+	 * Sets the subject of the email
+	 *
+	 * @param string $subject
+	 */
+	public function setSubject($subject) {
+		$this->subject = $subject;
+	}
+
 	/**
 	 * Adds a header to the email
 	 */
@@ -595,6 +606,15 @@ EOF;
 		$this->plainBody .= str_replace('<br>', PHP_EOL, $text);
 	}
 
+	/**
+	 * Returns the rendered email subject as string
+	 *
+	 * @return string
+	 */
+	public function renderSubject() {
+		return $this->subject;
+	}
+
 	/**
 	 * Returns the rendered HTML email as string
 	 *
diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php
index 04a3905c2e3d6330a11c34b2311a5a7e2fff0f2f..c1766076c449b4f002f8ae75fc345553353d48cf 100644
--- a/lib/public/Mail/IEMailTemplate.php
+++ b/lib/public/Mail/IEMailTemplate.php
@@ -52,6 +52,15 @@ namespace OCP\Mail;
  */
 interface IEMailTemplate {
 
+	/**
+	 * Sets the subject of the email
+	 *
+	 * @param string $subject
+	 *
+	 * @since 13.0.0
+	 */
+	public function setSubject($subject);
+
 	/**
 	 * Adds a header to the email
 	 *
@@ -130,6 +139,15 @@ interface IEMailTemplate {
 	 */
 	public function addFooter($text = '');
 
+	/**
+	 * Returns the rendered email subject as string
+	 *
+	 * @return string
+	 *
+	 * @since 13.0.0
+	 */
+	public function renderSubject();
+
 	/**
 	 * Returns the rendered HTML email as string
 	 *