butterfly/adapter-swift-mailer

Butterfly PHP. Swift Mailer Adapter

0.3.2 2020-05-12 12:39 UTC

This package is not auto-updated.

Last update: 2024-12-18 10:08:50 UTC


README

Sending emails

get('bfy_adapter.swift_mailer'); $mailer->sendPrepared('hello.world', array( 'name' => 'World', )); $mailer->flush(); Base template ------------- \#base.xml.twig

Configuration

bfy_adapter.twig.template_paths:

  • '%app.dir.root%/view/'

bfy_adapter.swift_mailer.prepared_mails: hello.world: transport: 'bfy_adapter.swift_mailer.transport.mailtrap' content_type: 'text/html' template: 'hello_world.html.twig' from: {'test@helloworlder.com': 'Robot'} to: 'agregad9@gmail.com'

services:

bfy_adapter.swift_mailer: class: 'Butterfly\Adapter\SwiftMailer\Mailer' arguments: - '%bfy_adapter.swift_mailer.prepared_mails%' - '#bfy_adapter.swift_mailer.transports' - '#bfy_adapter.swift_mailer.spools' - '@bfy_adapter.twig'

bfy_adapter.swift_mailer.transport.mailtrap: factoryStaticMethod: ['Swift_Mailer', 'newInstance'] arguments: ['@bfy_adapter.swift_mailer.transport_handler.mailtrap'] tags: 'bfy_adapter.swift_mailer.transports'

bfy_adapter.swift_mailer.transport_handler.mailtrap: class: 'Swift_SmtpTransport' calls: - ['setHost', ['mailtrap.io']] - ['setPort', ['2525']] - ['setUsername', ['22233f3bd7436f471'], true] - ['setPassword', ['47750b24d980a8'], true] - ['setEncryption', ['tls'], true] - ['setAuthMode', ['cram-md5'], true]

bfy_adapter.swift_mailer.transport.mailtrap.spool: factoryStaticMethod: ['Swift_Mailer', 'newInstance'] arguments: ['@bfy_adapter.swift_mailer.transport_handler.mailtrap.spool'] tags: 'bfy_adapter.swift_mailer.spools'

bfy_adapter.swift_mailer.transport_handler.mailtrap.spool: factoryStaticMethod: ['Swift_SpoolTransport', 'newInstance'] arguments: ['@bfy_adapter.swift_mailer.spool.mailtrap']

bfy_adapter.swift_mailer.spool.mailtrap: class: 'Swift_FileSpool' arguments: ['%app.dir.root%/var']

bfy_adapter.twig.environment: class: 'Twig_Environment' arguments: [@bfy_adapter.twig.loader, %bfy_adapter.twig.configuration%] calls: - ['setExtensions', [#bfy_adapter.twig.extensions/toArray]]