ptejada/laravel-mailgun-options 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ptejada/laravel-mailgun-options

Composer 安装命令:

composer require ptejada/laravel-mailgun-options

包简介

Laravel mailgun driver helper to toggle email opens, clicks, tag emails and more per mailable.

README 文档

README

The package enhances the builtin Laravel Mailgun driver with helpers to manage the Mailgun specific features in a per email message basis. The following options can be configures with the helper:

  1. Toggle tracking email opens.
  2. Toggle tracking email link clicks.
  3. Add email tags.
  4. Attach variables and recipient variables to email.
  5. Enable test mode.
  6. Schedule email to be delivery in the future.

Refer to the Send via SMTP section of the Mailgun API docs for more information.

Installation

Install package via composer

composer require ptejada/laravel-mailgun-options

Compatibility

The package is tested and should be compatible with the following PHP and Laravel versions

PHP Laravel
7.3 7.x
7.4 7.x, 8.x
8.0 7.x, 8.x, 9.x
8.1 8.x, 9.x

Usage

Add the PabloTejada\MailgunOptions\MailgunOptions trait to any mailable class you want to configure. Within the build method of the mailable you can configure the Mailgun options using the following helpers:

  • track() - Track both email opens and clicks.
  • trackClicks() - Track when links in the email ar clicked.
  • trackOpens() - Track when the email is opened.
  • deliverBy() - Schedules the email to be deliver at a later time.
  • testMode() - Sends the email in test mode.
  • tags() - Adds one or more tags to the email.
  • variables - Attach variables to the email.
  • recipientVariables - Attach recipient specific variables to the email.
  • dkimSignature - Toggles the DKIM signatures.

Example mailable class

<?php

namespace App\Email;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use PabloTejada\MailgunOptions\MailgunOptions;

class EmailNotification extends Mailable
{
    use Queueable, SerializesModels, MailgunOptions;

    /**
     * @return EmailNotification
     */
    public function build()
    {
        $this->to('pablo@tejada.dev', 'Pablo Tejada');
        
        // Track email opens and clicks
        $this->track();
        
        // Add email tag or campaign    
        $this->tags('Test Campaign');
        
        // Enables the test mode if the app is not in production
        if ( ! app()->environement('production') ) {
        	$this->testMode();
        }

        return $this->markdown('email');
    }    
}

License

Laravel Mailgun Options is open-source software licensed under the MIT license.

统计信息

  • 总下载量: 36
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固