Coder Social home page Coder Social logo

azine / azinemailgunwebhooksbundle Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 7.0 408 KB

Symfony Bundle to easily capture feedback from mailgun.com via their provided webhooks

License: MIT License

PHP 80.79% Shell 0.74% Twig 18.31% Dockerfile 0.16%

azinemailgunwebhooksbundle's People

Contributors

alister avatar azine avatar cristianfierro avatar eugene-o-z avatar nevstokes avatar thatside-zaraffa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

azinemailgunwebhooksbundle's Issues

Json decoding to an object by default

PHP Warning:  Invalid argument supplied for foreach() in 
 ...Azine/MailgunWebhooksBundle/Entity/MailgunEvent.php on line 36

The json_decode returns objects by default. json_decode($json, true) will return as an associative array.

Migrate routing definitions to newer syntax

The current routing definitions trigger deprecation notices in Symfony 2.8 as you can see below

DEPRECATED - The "pattern" option in file "/path/to/app/vendor/azine/mailgunwebhooks-bundle/Azine/MailgunWebhooksBundle/Resources/config/routing/mailgunevent_webhook.yml" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.

Simply replacing all occurrences of pattern with path should do the trick.

./Commands/*.php not auto-registered as of Symfony 3.4

Auto-registration of the command "Azine\MailgunWebhooksBundle\Command\DeleteOldEntriesCommand" is deprecated since Symfony 3.4

it's an easy fix though. They can be autoconfigured (with Symfony 3.3+) or for backward compatibility, added to the services.yml file and tagged tags: ['console.command'].

With services in 3.4/4.0+ also being made private by default, it may also be good to convert the commad from extends ContainerAwareCommand to a service (extends Command), and injecting requirements in the constructor, instead of $this->getContainer()->get('azine_mailgun.service'); (in getMailgunService()).

Make Bundle "Symfony 4"-ready.

The commands should no longer extend ContainerAwareCommand, but be converted to "normal" services with their dependencies injected in the constructor.

Also see #15 (comment)

PS: PRs are welcome.

update README

Symfony 3+ changed app/console to bin/console and router:debug to debug:router.

So

    php app/console router:debug -e prod | grep mailgunevent_webhook

should be

    php bin/console debug:router -e prod | grep mailgunevent_webhook

MailgunEvent field lengths can be too large for the database fields

While developing some emails to be sent from my application, I sent an email from dev that was sent through Mailgun, and so generated an event.

However, the bundle attempted to insert the string 'Unknown' into the 'country' field (and would have tried to do the same for 'region'). 'Country' has a DB length of 2 characters, 'region' has a length of 4. In the events documentation, one example 'region' is also given as 'Texas' (for the 'opened' event).

Make AzineMailgunWebhooksBundle compatible with Symfony 4

As of Symfony Flex, directly requiring symfony/symfony does not work anymore. Instead, you should require only exactly the components you need, e.g. symfony/routing, symfony/translation and so on.

Otherwise - and this is currently the case - this bundle won't work with Symfony Flex and/or Symfony 4.

Move code into a src/ directory, and change to PSR-4 autoloading

No whitelist configured, no code coverage will be generated. Moving the code files into a sub-directory allows for easier phpunit.xml configuration, and tidy up the root of the project. Tests/ can stay in the root.

Migrating to PSR-4 style loading is also best practice, but any changes there should be transparent with the use of Composer.

Xliff/Translations fatal error

After I updated to the latest version, every pages throws this exception:

An exception has been thrown during the rendering of a template ("Invalid resource provided: "1.2"; Errors: [ERROR 1867] Element '{urn:oasis:names:tc:xliff:document:1.2} source', attribute 'state': The attribute 'state' is not allowed. (in /home/.../web/ - line 14, column 0)

The Xliff schema does mention 'state', but it's not on source, its on the next element - target.

Also: #18 (comment)

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.