I want to send an Email that has XML as content.
I've created a blade view for this called xml_email.blade.php
to which I pass the variables that conform the email.
My xml_email.blade.php
looks like this:
{{ '<'.'?'.'xml version="1.0" encoding="UTF-8"?>' }}
<customer>
<contact>
<name part="full">{{$customer->name}}</name>
@if($customer->allow_phone == true)
<phone>{{$customer->phone}}</phone>
@endif
<email>{{$customer->email}}</email>
</contact>
</customer>
And I am sending it like this from a controller
Mail::send('emails.xml_email', ['customer' => $customer], function($message){
$message->to("recipient@email.com", '')->subject('New Customer!');
});
The email gets sent however is not in XML format and all the tags are missing.
Is there a way to change the Mime Type of the email to text/xml
or to keep all the XML tags when sent?
Thanks!