angularjs - How to stop htmlentites when use summernote and laravel to send html e-mail? -
i having issue laravel 5.1 , summernote. using summernote compose email sending via angular.js laravel 5.1 api.
i have debugged as can cannot seem email sending in html code renders correctly.
the message source correctly shows email being sent in html somehow body of email keeps being converted htmlentities , html code showing in email body when received.
my mail send command in laravel follows.
$params = json_decode(file_get_contents('php://input'),true); $body = $params['body']; $to_address = $params['to']; $subject = $params['subject']; mail::send(['html' => 'emails.send_email'], ['body'=>$body], function ($message) use ($to_address, $subject){ $message->from($to_address); $message->subject($subject); $message->to($to_address); });
the text body text have tried in summernote simply,
test test
which coming through
test<br>test
message source has in leading me htmlentities issue.
content-type: text/html; charset=utf-8 content-transfer-encoding: 7bit <body> test<br><br>test<br> </body>
the angular.js code gather summernote details
sendemail($scope.to, $scope.subject, $scope.body).then(function(){ // clear out compose $scope.subject = ''; $scope.body = ''; $scope.success_message_sent = true; });
then sending function
$scope.sendemail = function(to, subject, body) { var deferred = $q.defer(); var data = { 'to': to, 'subject': subject, 'body': body }; $http.post('http://'+ remoteserver +'/api/send_email', data) .success(function() { deferred.resolve(); }) .error(function() { deferred.reject("failed send message"); }); return deferred.promise;
i using mandrill send email.
any assistance appreciated.
thanks
i believe issue coming template:
in emails.send_email.blade.php
use {!! $body !!}
prevent htmlentities issue
Comments
Post a Comment