PHPackages                             sanlilin/laravel-email-templates - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. sanlilin/laravel-email-templates

ActiveLibrary[Templating &amp; Views](/categories/templating)

sanlilin/laravel-email-templates
================================

Laravel Email Templates (Blade)

030Blade

Since Mar 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/WHBLeer/laravel-email-templates)[ Packagist](https://packagist.org/packages/sanlilin/laravel-email-templates)[ RSS](/packages/sanlilin-laravel-email-templates/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-mail-templates
======================

[](#laravel-mail-templates)

Laravel (Blade)会员和电商网站电子邮件模板。

与Laravel: Mailer, Language, Config完全集成，并为Laravel使用Blade模板格式。从语言系统或配置设置中设置内容选项。

易于添加到当前应用程序，不需要复杂的集成步骤。三个简单的集成步骤

可用模板
----

[](#可用模板)

- 注册欢迎信息 Template
- 验证邮箱 Template
- 忘记密码 Template
- 付款成功 Template
- 商户下单 Template
- 买家下单 Template
- 订单发货 Template
- 需求提交 Template
- 需求回复 Template
- 账单/发票 Template
- 提醒 Template

安装使用
----

[](#安装使用)

在应用程序上安装这个库

```
composer require --dev sanlilin/laravel-email-templates
```

自动复制文件和文件夹到相同的结构在您的Laravel应用程序。

```
php artisan vendor:publish --provider=Sanlilin\\EmailTemplatesServiceProvider
```

如果您只想复制文件的一部分，您可以使用标记。

```
php artisan vendor:publish --tag=email-templates-config    // 发布配置文件
php artisan vendor:publish --tag=email-templates-views     // 发布视图文件
php artisan vendor:publish --tag=email-templates-lang      // 发布多语言文件
php artisan vendor:publish --tag=email-templates-img       // 发布图片文件
php artisan vendor:publish --tag=email-templates-app       // 发布App文件
```

### 手动

[](#手动)

或者，您可以自己将这些文件复制到您的Laravel应用程序中。

```
    /config/email-template.php
    /resources/views/email/*
    /resources/lang/en/email.php
    /public/assets/img/email/*
    /app/Mail/*
```

使用
--

[](#使用)

- 编辑 `config/email-template.php` 和 `/resources/lang/en/email.php` 中的值

    **注:** 只改变右边的值，不改变左边的变量
- 确保您的 `config/mail.php` 文件已更新，以设置全局地址等。

```
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ],
```

发送欢迎信息邮件
--------

[](#发送欢迎信息邮件)

从控制器中简单地调用mailable。您还可以将一些可选变量作为数组发送。

```
    use App\User;
    use App\Mail\WelcomeMember;

    $options = array(
        'unsubscribe_url'   => 'http://mysite.com/unsub',
        'play_url'          => 'http://google-play.com/myapp',
        'ios_url'           => 'http://apple-store.com/myapp',
        'sendfriend_url'    => 'http://mysite.com/send_friend',
        'webview_url'       => 'http://mysite.com/webview_url',
    );

    $user = User:find(1);
    Mail::to($user)->send(new WelcomeMember($user, $options));
```

预览邮件
----

[](#预览邮件)

如果您想在使用电子邮件之前预览它们，请将`routes/web.php`的内容复制到您的版本。记得在启动应用程序之前删除这些路由。

然后打开这些url以预览邮件模板

- `yourdomain.com/email_template/welcome_member`
- `yourdomain.com/email_template/verify_email`
- `yourdomain.com/email_template/forgot_password`
- `yourdomain.com/email_template/thanks_payment`

示例路由 `routes/web.php`

```
    Route::get('email_template/welcome_member', function () {

        $member = App\User::find(1);
        return new App\Mail\WelcomeMember($member);
    });
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6aa8ddf5aa785926032d7c2cf0475d59a7f1a76a03ec9bf482f371be01cbe558?d=identicon)[WHBLeer](/maintainers/WHBLeer)

---

Top Contributors

[![WHBLeer](https://avatars.githubusercontent.com/u/30891605?v=4)](https://github.com/WHBLeer "WHBLeer (6 commits)")

### Embed Badge

![Health badge](/badges/sanlilin-laravel-email-templates/health.svg)

```
[![Health](https://phpackages.com/badges/sanlilin-laravel-email-templates/health.svg)](https://phpackages.com/packages/sanlilin-laravel-email-templates)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
