承接 rezzza/mail-extra-bundle 相关项目开发

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

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

rezzza/mail-extra-bundle

Composer 安装命令:

composer require rezzza/mail-extra-bundle

包简介

Mail tools for Swift_Mailer.

README 文档

README

Add transformer to your mail before sending it.

Transformers already added:

html2text

Needs binary html2text Install: brew install html2text

This transformer will create a text/plain verion of your HTML message and add it as part.

PictureEmbed

This transformer will look at picture on your html email and add pictures in embed of mail.

Add your transformer

Add it to the config.yml

rezzza_mail_extra:
    transformers:
        mytransforrmer:
            id:         service_id
            options:    [] # some options

Your service_id should implements TransformerInterface, example:

<?php

namespace MyNamespace\Transformer;

use Rezzza\MailExtraBundle\Transformer\AbstractTransformer;
use Rezzza\MailExtraBundle\Transformer\TransformerInterface;

class MyTransfrormer extends AbstractTransformer implements TransformerInterface
{
    /**
     * {@inheritdoc)
     */
    public function transform(\Swift_Mime_Message $message)
    {
        // transform message
    }

    /**
     * {@inheritdoc)
     */
    public function supports(\Swift_Mime_Message $message)
    {
        return true; // if the message is supported by this transformer ?
    }

}

Activate transformers

You can activate by default a transformer by use the default key on config.

Else, on the mailer, use:

<?php
$transformerProcessor = $this->get('rezzza.transformer.processor'); // or replace by direct definition
$transformerProcessor->activate('my_transformer'); // activate
$transformerProcessor->deactivate('my_transformer'); // deactivate

Full configuration reference:

rezzza_mail_extra:
    mailer_class: Rezzza\MailExtraBundle\Mailer\Mailer
    transformers: # list of transformers
        html2text:
            id:         rezzza.transformer.html2text # service identifier
            default:    false # is used by default on each mail
            enabled:    true # can be disabled for tests for example.
            options:    # some options
                binary: /usr/local/bin/html2text
        picture_embed:
            id:         rezzza.transformer.picture_embed

If you have any questions or improvements, create an issue or contact us.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固