Hi,
I’m using the built-in email-engine to confirm event-registrations. While the emails get rendered correcty using the html-template, the content-type in the header says “text/plain”. Consequently, email-clients display the html-code in plain text instead of interpreting it.
This is the script:
$kirby->email([
'template' => 'email.html',
'from' => 'from@example.com',
'replyTo' => 'reply-to@example.com',
'to' => 'to@example.com',
'subject' => esc($data['pagetitle']),
'data' => [
'message' => esc($data['message']),
'name' => esc($data['name']),
],
]);
The email-output looks like this:
To: to@example.com
Subject: Event A
Date: Wed, 22 May 2019 12:30:46 +0000
From: from@example.com
Reply-To: reply-to@example.com
Message-ID: <5p5tDYEr8PLj1eyFA1iWqvmjnSogcLGZwQyesO1xdkY@localhost>
X-Mailer: PHPMailer 6.0.7 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Hi srgdhf</h1>
<p></p>
</body>
</html>
Maybe I’m just missing something?
Thank you.