Heim  >  Artikel  >  Backend-Entwicklung  >  So senden Sie Formulare im E-Mail-Vorlagenstil in Laravel

So senden Sie Formulare im E-Mail-Vorlagenstil in Laravel

小云云
小云云Original
2018-03-15 11:07:512842Durchsuche

In diesem Artikel erfahren Sie hauptsächlich, wie Laravel Formular-E-Mail-Vorlagenstile sendet. Ich hoffe, dass er Ihnen helfen kann.

Code:

@extends(&#39;emails/master_email&#39;)#这个就是样式,外联的样式在qq邮箱里面不能显示<style type="text/css">#customers{
  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
  width:100%;
  border-collapse:collapse;
}#customers td, #customers th{
  font-size:1em;  /*细线边框颜色*/
  border:1px solid #1E9FFF;
  text-align: left;
}#customers th{
  font-size:1.1em;
  text-align:left;  /*表头背景颜色*/
  background-color:#1E9FFF;
  color:#ffffff;}#customers tr.alt td{
  color:#000000;
  background-color:#EAF2D3;}

</style>
@section(&#39;content&#39;)
<p class="wrapper wrapper-content animated fadeInRight">
    <p class="row">
        <p class="col-sm-12">
            <p class="ibox float-e-margins">
                {{-- 表格内容 --}}
                <p class="ibox-content">
                    <table id="customers">
                        <caption><h2 align="center" style="color: black;">{{$data->range}}注册用户信息表</h2></caption>
                        <thead>
                            <tr>
                                <th>用户名</th>
                                <th>用户类型</th>
                                <th>用户邮箱</th>
                                <th>注册时间</th>
                                <th>最近一次登陆时间</th>
                                <th>最近一次学习课程时间</th>
                                <th>最近一次学习练习时间</th>
                            </tr>
                        </thead>
                        @if (count($data))
                        {{-- @if ($data->total()>0) --}}
                        <tbody>
                            @foreach ($data as $key=>$element)
                            {{-- 这个key用来判断隔行换色 --}}
                            <tr class="{{ ($key%2==1)?&#39;alt&#39;:&#39;&#39; }}">
                                <td>{{$element->user_name}}</td>
                                <td>{{$element->customer_type}}</td>
                                <td>{{$element->email}}</td>
                                <td>{{$element->create_time}}</td>
                                <td>{{$element->loginInTokens[0]->login_time or &#39;未登录&#39;}}</td>
                                <td>{{$element->lessonRecords[0]->update_time or &#39;未学习&#39;}}</td>
                                <td>{{$element->exerciseRecords[0]->update_time or &#39;未学习&#39;}}</td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                    @else
                    <tbody>
                        <tr ><td colspan="7"><p><h3 align="center">近一周没有注册用户,我们需要继续努力啊!</h3></p></td></tr>
                    </tbody>
                </table>
                @endif

            </p>

        </p>

    </p>
</p>
@endsection

Wirkung:

So senden Sie Formulare im E-Mail-Vorlagenstil in Laravel

Das obige ist der detaillierte Inhalt vonSo senden Sie Formulare im E-Mail-Vorlagenstil in Laravel. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn