libre-informatique/email-bundle 问题修复 & 功能扩展

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

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

libre-informatique/email-bundle

Composer 安装命令:

composer require libre-informatique/email-bundle

包简介

Email Bundle for Symfony

README 文档

README

Travis Coveralls License

Latest Stable Version Latest Unstable Version Total Downloads

About

The Libre Informatique EmailBundle leverages Swiftmailer and the Libre Informatique CoreBundle to provide seemless email and newsletter functionalities. Features include database spooling, configurable spool flush command, email openings and link clicks tracking along with stats display, inline attachments, templating, duplication, ...

Installation

$ composer require libre-informatique/email-bundle

// app/AppKernel.php
// ...
public function registerBundles()
{
    $bundles = array(
        // ...
            
        // the libre-informatique bundles
        new Librinfo\EmailBundle\LibrinfoEmailBundle(),
            
        // your personal bundles
        // ...
    );
}

Configuration

Dependencies

    // app/AppKernel.php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            
            // Sonata
            new Sonata\CoreBundle\SonataCoreBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
            new Sonata\AdminBundle\SonataAdminBundle(),
            new Sonata\IntlBundle\SonataIntlBundle(),

            // Blast
            new Blast\OuterExtensionBundle\BlastOuterExtensionBundle(),
            new Blast\CoreBundle\BlastCoreBundle(),
            new lbr\BlastTestBundle\BlastTestBundle(),
            new Blast\BaseEntitiesBundle\BlastBaseEntitiesBundle(),
            new Blast\UtilsBundle\BlastUtilsBundle(),

            // Attachments
            new Librinfo\MediaBundle\LibrinfoMediaBundle(), 
          
            // Wisiwig editor
            new Stfalcon\Bundle\TinymceBundle\StfalconTinymceBundle(),

            // your personal bundles
            // ...
        );
    }
    // ...
# app/config/routing.yml
admin:
    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
    prefix: /
  
_sonata_admin:
    resource: .
    type: sonata_admin
    prefix: /

blast_core:
    resource: "@BlastCoreBundle/Resources/config/routing.yml" 
    prefix:   /admin

email:
    resource: "@LibrinfoEmailBundle/Resources/config/routing.yml"
    prefix: /admin
# app/config/config.yml
sonata_block:
    default_contexts: [cms]
    blocks:
        # Enable the SonataAdminBundle block
        sonata.admin.block.admin_list:
            contexts:   [admin]
        # Your other blocks

But please, refer to the source doc to get up-to-date : https://sonata-project.org/bundles/admin/2-3/doc/reference/installation.html

Just notice that the prefix value is / instead of /admin as advised by the Sonata Project... By the way, it means that this access is universal, and not a specific "backend" interface. That's a specificity of a software package that intends to be focused on professional workflows.

Don't forget to publish assets as some features of the bundle such as file upload rely heavily on javascript.

Add the custom form field template to your config.yml:

# app/config/config.yml
twig:
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    form_themes:
        - 'SonataCoreBundle:Form:datepicker.html.twig'
        - 'SonataCoreBundle:Form:colorpicker.html.twig'
        - 'BlastCoreBundle:Admin/Form:fields.html.twig'
        - 'BlastUtilsBundle:Form:fields.html.twig'
        - 'BlastBaseEntitiesBundle:Form:fields.html.twig'
        - 'LibrinfoMediaBundle:Form:fields.html.twig'

Spooling

You have to configure two mailers as follows in order to use the database spooling feature (one for direct sned, the other for spool send)

# app/config/config.yml

swiftmailer:
    default_mailer: direct_mailer
    mailers:
        direct_mailer:
            transport: "%mailer_transport%"
            host:      "%mailer_host%"
            username:  "%mailer_user%"
            password:  "%mailer_password%"
        spool_mailer:
            transport: "%mailer_transport%"
            host:      "%mailer_host%"
            username:  "%mailer_user%"
            password:  "%mailer_password%"
            spool: { type: db }

To flush the queue execute the command : $ app/console librinfo:spool:send

Don't hesitate executing the command with --help as it has more options than the swiftmailer:spool:send

Tracking

If you want to use the tracking functionalities, you need to add an access control rule to your security.yml that will allow anonymous users to access routes with the prefix '/tracking' like so:

# app/config/security.yml
access_control:
        # ...
        - { path: ^/tracking, role: IS_AUTHENTICATED_ANONYMOUSLY } # allow access to tracking controller for anonymous users

That's it !

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2016-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固