承接 ride/lib-mail-mandrill 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ride/lib-mail-mandrill

Composer 安装命令:

composer require ride/lib-mail-mandrill

包简介

Mandrill implementation for the mail library of the Ride framework

README 文档

README

Mandrill implementation for the mail library of the PHP Ride framework.

For more information, you can check the Mandrill website.

What's In This Library

MandrillTransport

The MandrillTransport class implements the Transport interface. It uses the Mandrill rest API to send mails. You can set tags and the subaccount for all mails sent by the transport.

MandrillMailMessage

The MandrillMessage class extends the MailMessage class. You can set tags and the subaccount for a mail message individually.

Code Sample

<?php

use ride\library\log\Log;
use ride\library\mail\transport\MandrillTransport;

function createTransport($apiKey, Log $log) {
    $transport = new MandrillTransport($apiKey, $log);
    
    // a tag and subaccount to be set on all mails which don't set tags or a subaccount
    $transport->addTag('newsletter');
    $transport->setSubAccount('my-subaccount');
    
    return $transport;
}

function sendMail(MandrillTransport $transport) {
    // like any mail message
    $message = $transport->createMessage();
    $message->setSubject('My subject');
    $message->setRecipient('to@domain.com');
    $message->addCc('To 2 <to2@domain.com>');
    $message->addBcc(array('to3@domain.com', 'To 3 <to3@domain.com>'));
    $message->setIsHtmlMessage(true);
    $message->setMessage('<html><body><p>...</p></body></html>');
    
    // mandrill extension, override the transport tags and subaccount
    $message->addTag('registration');
    $message->setSubAccount('my-other-subaccount');
    
    // send it
    try {
        $transport->send($message);
    } catch (MailException $exception) {
        
    }
}

Related Modules

Installation

You can use Composer to install this library.

composer require ride/lib-mail-mandrill

统计信息

  • 总下载量: 3.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固