2017 © Pedro Peláez
 

library easymailbundle

The easyMailBundle, for Symfony2, provide an easy way to send email with temple

image

samdeb/easymailbundle

The easyMailBundle, for Symfony2, provide an easy way to send email with temple

  • Monday, May 29, 2017
  • by samrodriguez
  • Repository
  • 1 Watchers
  • 0 Stars
  • 105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

easyMailBundle

The easyMailBundle, for Symfony2, provide an easy way to send email with temple, (*1)

Installing

easyMailBundle uses Composeris, please checkout the composer website for more information., (*2)

The simple following command will install easyMailBundle into your project. It also add a new entry in your composer.json and update the composer.lock as well., (*3)

composer require samdeb/easymailbundle:dev-master

Once the new project is set up, open the composer.json file and add the samdeb/easymailbundle as a dependency: ``` js //composer.json //... "require": { //other bundles "samdeb/easymailbundle": "dev-master", (*4)

Save the file and have composer update the project via the command line:
``` shell
composer update

Now just update the app/AppKernel.php: ``` php //app/AppKernel.php //... public function registerBundles() { $bundles = array( //Other bundles new ABC\EasyMailBundle\ABCEasyMailBundle(), );, (*5)


<a name="configuration"></a> ### Configuration example Add the bundle to orm configuration: You can configure default query parameter names and templates

app/config/config.yml

...

abc_easy_mail: from: system@mydomain.com reply: soporte@mydomain.com default_theme : ~, (*6)

or

app/config/config.yml

...

abc_easy_mail: from: system@mydomain.com reply: soporte@mydomain.com default_theme : mytheme themes: mytheme: twig: ABCEasyMailBundle:Default:easyMail.html.twig logo: 'https://github.com/samrodriguez/easyMailBundle/blob/master/web/img/logo.png' title: 'Company Name' footer: 'Atte.' othertheme: twig: MyBundle:Default:mail.html.twig, (*7)


and now you're done. ## Usage examples: ### Controller (Basic) ```php // ABC\EasyMailBundle\Controller\DefaultController.php class DefaultController extends Controller { public function indexAction() { $mail = $this->get('easy.mailer'); $settings = array( 'to'=>'email@mydomain.com', 'subject' => 'This is my subject', 'body' => array( 'content' => 'Put your text', ) ); $mail->send($settings); return $this->render('ABCEasyMailBundle:Default:index.html.twig'); } }

Controller (Advanced)

// ABC\EasyMailBundle\Controller\DefaultController.php

class DefaultController extends Controller
{
    public function indexAction()
    {
        $mail = $this->get('easy.mailer');
        $settings = array('default_theme'=>'other',
                          'to'=>'email@mydomain.com',
                          /*
                          'cc'=>'myemail@mydomain.com',
                          'bcc'=> 'otheremail@mydomain.com',
                          */
                          'subject' => 'This is my subject',
                          'body'    => array(
                                        /*
                                         'logo'   => 'Mylogo.jpg',
                                         'title'  => 'Diferent Company Name',
                                         */
                                        'content' => 'Put your text',
                                        'footer'  => 'Saludos'
                                    )
                    );
        $mail->send($settings);
        return $this->render('ABCEasyMailBundle:Default:index.html.twig');
    }
}

View

{% extends "ABCEasyMailBundle:Default:Layout.html.twig" %}

{% block logo %} {{logo}} {% endblock %}
{% block title %} {{title}} {% endblock %}
{% block content %} {{content}} {% endblock %}
{% block footer %} {{footer}} {% endblock %}

The Versions

29/05 2017

dev-master

9999999-dev

The easyMailBundle, for Symfony2, provide an easy way to send email with temple

  Sources   Download

MIT

The Requires

 

mail symfony2

25/05 2017

v1.0

1.0.0.0

The easyMailBundle, for Symfony2, provide an easy way to send email with temple

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

mail symfony2