mitismirza's avatar

Email template Mess when Forwarding it!

hey

i have a form that submit some info and email it to a email , i write it with laravel.

when email recieved is ok and showing a simple template like this:

https://cdn.pbrd.co/images/HvBDcHL.png

but when i click on forward it will showing just texts and dismiss styles:

https://cdn.pbrd.co/images/HvBDIyU.png

this is my email blade that have styles :

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <title>ایمیل </title>
    @include('min_style')
    <style>
        body{
            direction: rtl;
            font-size: 11px;
        }
    </style>
</head>

<body>
<h4 style="color: #1c7430;direction: rtl;text-align:right;"> شکایت جدید از طرف آقا/خانم {!! $info->pluck('name')->pop() !!} دریافت شد </h4>
<hr>

<table class="table " style="direction: rtl;  text-align: center;" >
    <thead class="thead-dark" style="direction: rtl;  text-align: center;">
    <tr style="direction: rtl;  text-align: center;">
        <th  style="direction: rtl;  text-align: center;" scope="col">موضع شکایت</th>
        <th  style="direction: rtl;  text-align: center;" scope="col">شرح شکایت یا تخلف</th>
        <th style="direction: rtl;  text-align: center;" scope="col">پیشنهاد جهت رفع مشکل</th>
        <th style="direction: rtl;  text-align: center;" scope="col">تلفن</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <th >{!! $info->pluck('moze_shekayat')->pop() !!}</th>
        <td>{!! $info->pluck('sharh_shekayat')->pop() !!}</td>
        <td>{!! $info->pluck('pishnahad')->pop() !!}</td>
        <td>{!! $info->pluck('phone')->pop() !!}</td>
    </tr>
    </tbody>
</table>

</body>
</html>

and the '@include(min_style)' blade have:

<style>
    /*! CSS Used from: Embedded */
    *,::after,::before{box-sizing:border-box;}
    body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:right;background-color:#fff;}
    hr{box-sizing:content-box;height:0;overflow:visible;}
    h4{margin-top:0;margin-bottom:.5rem;}
    table{border-collapse:collapse;}
    th{text-align:inherit;}
    h4{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit;}
    h4{font-size:1.5rem;}
    hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1);}
    .table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent;}
    .table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6;}
    .table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6;}
    .table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e;}
    @media print{
        *,::after,::before{text-shadow:none!important;box-shadow:none!important;}
        thead{display:table-header-group;}
        tr{page-break-inside:avoid;}
        body{min-width:992px!important;}
        .table{border-collapse:collapse!important;}
        .table td,.table th{background-color:#fff!important;}
    }
    /*! CSS Used from: Embedded */
    body{direction:rtl;font-size:11px;}
</style>


what's happening when i click on forward whay styles mess!

0 likes
2 replies
lostdreamer_nl's avatar

That depends on your email client.

It could be that the email client rather sends out rtf type emails instead of html ones, trying to parse the HTML email and recreate it.

If you fix it for this client, it can still happen in other email clients.

Please or to participate in this conversation.