2017 © Pedro Peláez
 

symfony-bundle form-by-email-bundle

Send your symfony2 forms by email, or your custom emails easily

image

muchomasfacil/form-by-email-bundle

Send your symfony2 forms by email, or your custom emails easily

  • Friday, August 9, 2013
  • by mmf-amarcos
  • Repository
  • 1 Watchers
  • 2 Stars
  • 52 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

FormByEmailBundle

Note this bundle works only with symfony >= 2.3.x, (*1)

Nothing new under the sun. This bundle just tryes to simplify sending your Symfony2 forms by email. It will help if you need to: - send forms by email (even if you use ajax forms) - just send emails, (*2)

setting sender and recipient and other data in an easy way, (*3)

Here you have some examples., (*4)

Fell free to send us your opinion, or issues., (*5)

Install bundle with composer.json

Add FormByEmailBundle to your composer.json:, (*6)

"require": {
    "muchomasfacil/form-by-email-bundle": "0.1.*"
},

You must add this entries to your app/AppKernel.php ``` php new MuchoMasFacil\FormByEmailBundle\MuchoMasFacilFormByEmailBundle(),, (*7)


Enable translation in your app/config/config.yml (optional but recommended) ``` yaml # ... framework: # ... translator: { fallback: %locale% } # ...

Finally run on your project (take care of "minimum-stability" if necesary) ``` bash composer.phar require muchomasfacil/FormByEmailBundle dev-master, (*8)

## Configure
In your app/config/config.yml you can:
``` yaml
mucho_mas_facil_form_by_email:
    definitions: 
        # overwrite bundle default configuration
        default:
            template: MuchoMasFacilFormByEmailBundle:Default:formByEmail.html.twig
            is_html: true        
            recipients_setBcc: [{ info@mycompany.com: 'My company info', mypersonal@gmail.com: 'My personal mail'}]
        # create your custom definitions
        my_txt_contact: 
            sender_setFrom: { info@yourcompany.com: 'Info yourcompany.com'}            
            recipients_setBcc: { info@mycompany.com: 'My company info', mypersonal@gmail.com: 'My personal mail'}

When you call php $render_params = $form_by_email->formByEmail($form, $default_data, $subject, $definition_to_load, $params); The final configuration used is formed by: - getting 'default' definition (you can overwrite it in your app/config/config.yml) - merging previous with definition set by the value in $definition_to_load - merging previous result with values in $params array, (*9)

If you need to pass custom params to your email template add them in $params, (*10)

Parameters reference

Take a look at default values in ./Resources/config/services.yml, (*11)

Param Type Reference
template string Email render template (take default template as a reference for your custom templates)
is_html boolean If sets email body content-type to text/html or text/plain
locale string By default will use request locale. If set forces locale
translation_domain string Bundle translation domain http://symfony.com/doc/current/book/translation.html
skip_fields array Form fields that will not show in the email
sender_setFrom array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#setting-the-from-address
sender_setSender string: single email address Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#setting-the-sender-address
sender_setReturnPath string: single email address Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#setting-the-return-path-bounce-address
sender_setReplyTo string: single email address Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#setting-the-return-path-bounce-address
recipients_setTo array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#adding-recipients-to-your-message
recipients_setCc array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#adding-recipients-to-your-message
recipients_setBcc array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#adding-recipients-to-your-message
recipients_addTo array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#adding-recipients-to-your-message
recipients_addCc array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#adding-recipients-to-your-message
recipients_addBcc array Look at SwiftMailer reference http://swiftmailer.org/docs/messages.html#adding-recipients-to-your-message

TODO

  • test if comunity finds it useful
  • Tests
  • Travis integration

The Versions

09/08 2013

dev-master

9999999-dev https://github.com/muchomasfacil/FormByEmailBundle

Send your symfony2 forms by email, or your custom emails easily

  Sources   Download

MIT

The Requires

 

by Alvaro Marcos

email form

02/07 2013

v0.1

0.1.0.0 https://github.com/muchomasfacil/FormByEmailBundle

Send your symfony2 forms by email, or your custom emails easily

  Sources   Download

MIT

The Requires

 

by Alvaro Marcos

email form