Coder Social home page Coder Social logo

azine / email-bundle Goto Github PK

View Code? Open in Web Editor NEW
64.0 64.0 24.0 669 KB

Symfony Bundle to automatically create and send emails (notification about events on your web-app or newsletters or any other tailored content) to your users.

License: MIT License

PHP 92.61% Shell 0.36% Brainfuck 0.01% Twig 7.02%

email-bundle's People

Contributors

azine avatar eugene-o-z avatar sadortun avatar samnela avatar strategy47 avatar tacman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

email-bundle's Issues

Upgrade to Swiftmailer 6

Unfortunately, it appears that Swiftmailer 6 changed how messages are instantiated, with no deprecation period. Now it is

$message = (new \Swift_Message('Subject of Email'))

instead of

 $message = \Swift_Message::newInstance()
      ->setSubject('Subject of Email')

This only shows up twice in the bundle, but not sure how this should be dealt with. Maybe with versioning? A 4.0 tag? (The 3.0 tag was from Jan, 2017).

Bundle is not compatible with Symfony Flex

composer req azine/email-bundle dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.2.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for __root__ dev-master -> satisfiable by __root__[dev-master].
    - azine/email-bundle dev-master requires azine/emailupdateconfirmation-bundle ~1.0 -> satisfiable by azine/emailupdateconfirmation-bundle[1.0.0, 1.0.1].
    - azine/emailupdateconfirmation-bundle 1.0.0 requires symfony/symfony ~2.7|^3.0|^4.0 -> satisfiable by symfony/symfony[v4.2.0, v4.2.1, v4.2.2, v4.2.3, v4.2.4].
    - azine/emailupdateconfirmation-bundle 1.0.1 requires symfony/symfony ~2.7|^3.0|^4.0 -> satisfiable by symfony/symfony[v4.2.0, v4.2.1, v4.2.2, v4.2.3, v4.2.4].
    - symfony/symfony v4.2.0 conflicts with __root__[dev-master].
    - symfony/symfony v4.2.1 conflicts with __root__[dev-master].
    - symfony/symfony v4.2.2 conflicts with __root__[dev-master].
    - symfony/symfony v4.2.3 conflicts with __root__[dev-master].
    - symfony/symfony v4.2.4 conflicts with __root__[dev-master].
    - Installation request for azine/email-bundle dev-master -> satisfiable by azine/email-bundle[dev-master].


Installation failed, reverting ./composer.json to its original content.

README provides incorrect instructions

README file contains the following, invalid instructions:

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Azine\EmailBundle\EmailBundle(),

should be:

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Azine\EmailBundle\AzineEmailBundle(),

This:

    # the service-id of your implementation of the web view service to be used
    web_view_service:     azine_email.example.web.view.service

should be:

    # the service-id of your implementation of the web view service to be used
    web_view_service:     azine_email.example.web_view_service

LICENSE

Hi,
Can you add LICENSE information.

I see you have : "license": "MIT", in the composer.json but would it be possible for you to add an explicit license in the actual codebase?

I can do a PR if you are happy for an MIT to be added.

Dependency on FOSUserBundle could be make optional

Looks like the dependency on FOSUserBundle can be made optional or abstracted such that the FOS Specific mail sending code may be used by custom implementations too. While FOSUserBundle may be the de-facto solution for Symfony auth system, it is not always the case.

flex recipe

Since recipient_class and a few other fields are required, a flex recipe would automatically create config/packages/azine_email.yaml, then cache:clear would work as part of the installation process.

Also, the default class could probably be App\Entity\User, since that's probably pretty common for people using FosUserBundle in Symfony4.

doc example problem

i do really want to send newsletter!
but how ?
i had try :

first of all the following line does not work :
immediateMailer: "@swiftmailer.mailer.immediateMailer"

so it was replaced with :
immediateMailer: "@mailer"
OR

immediateMailer: "@swiftmailer.mailer.immediateMailer"

then :
class User extends BaseUser implements \Azine\EmailBundle\Entity\RecipientInterface

the user class was implemented by RecipientInterface

then i had run :
emails:sendNewsletter

the result was :
Thu, 12 Feb 2015 08:37:34 +0100 : starting to send newsletter emails.
Thu, 12 Feb 2015 08:37:34 +0100 : 0 newsletter emails have been sent.
Thu, 12 Feb 2015 08:37:34 +0100 : The following email-addresses failed:

what should i do ?

services.yml incompatible with Symfony 3.3.6

When I wanted to update my Symfony project to Symfony 3.3.6,, Composer let me do it (while requerring AzineEmailBundle at dev-master). The problem is that AzineEmailBundle has a services.yml syntax which is no longer accepted in Symfony. The argument names in services declarations need to be like $name_of_the_php_argument: argument_value and cannot (anymore) be like name_of_the_argument: argument_value. For instance,

    azine_email.example.template_provider:
        class: Azine\EmailBundle\Services\AzineTemplateProvider
        arguments:
          router:       "@router"
          translator:   "@translator.default"
          parameters:
            image_dir:  "%azine_email_image_dir%"
            allowed_images_folders: "%azine_email_allowed_images_folders%"
            tracking_params_campaign_name:    "%azine_email_tracking_params_campaign_name%"
            tracking_params_campaign_term:    "%azine_email_tracking_params_campaign_term%"
            tracking_params_campaign_content: "%azine_email_tracking_params_campaign_content%"
            tracking_params_campaign_medium:  "%azine_email_tracking_params_campaign_medium%"
            tracking_params_campaign_source:  "%azine_email_tracking_params_campaign_source%"

should be replaced by

    azine_email.example.template_provider:
        class: Azine\EmailBundle\Services\AzineTemplateProvider
        arguments:
          $router:       "@router"
          $translator:   "@translator.default"
          $parameters:
            image_dir:  "%azine_email_image_dir%"
            allowed_images_folders: "%azine_email_allowed_images_folders%"
            tracking_params_campaign_name:    "%azine_email_tracking_params_campaign_name%"
            tracking_params_campaign_term:    "%azine_email_tracking_params_campaign_term%"
            tracking_params_campaign_content: "%azine_email_tracking_params_campaign_content%"
            tracking_params_campaign_medium:  "%azine_email_tracking_params_campaign_medium%"
            tracking_params_campaign_source:  "%azine_email_tracking_params_campaign_source%"

I tried to override this file but I couldn't, which led to an error stipulating that the first argument of service azine_email.example.template_provide should be named with the $ symbol, or by referring its index in the arguments list with an integer. The order of the arguments no longer have a predominant role like it did in previous versions of Symfony.

I know AzineEmailBundle is a Symfony2 bundle, but as Composer allows to use it with Symfony 3.3.6, and as the bundle is completely compatible on the other levels, I wondered: is something going to be done about this? I see two possible fixes:

  • rename arguments with the $ symbol in services.yml
  • omit argument names in services.yml, only relying on their order in the constructor signature

Examples

I'm trying to use the bundle to manage email notifications. Ca you please provide an example on how to send an email notification using a twig template.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.