GithubHelp home page GithubHelp logo

fmikl / newsletterbundle Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14 KB

A Symfony application bundle for managing newsletters, giving users the ability to subscribe or unsubscribe, and allowing the administrator to send out newsletters.

License: MIT License

PHP 97.00% Twig 3.00%
symfony-bundle symfony6

newsletterbundle's Introduction

NewsletterBundle

About

This project is an application bundle for Symfony, designed to be intrinsically integrated into an existing application. It revolves around a newsletter management system, enabling the efficient dispatch of information and announcements to subscribed users.

Configuration

Installation

Clone the repository into your Symfony project:

git clone https://github.com/mikael-fourre/NewsletterBundle

Ensure the bundle is registered in your config/bundles.php file:

return [
    // ...
    App\Bundle\NewsletterBundle\NewsletterBundle::class => ['all' => true],
];

Routing Configuration

Add the bundle's routes to your routing configuration.

# config/routes.yaml

newsletter_bundle:
    resource: '@NewsletterBundle/config/routes.yaml'

The routes provided by the bundle are:

  • newsletter_subscribe: Handles newsletter subscriptions
  • newsletter_confirm: Manages subscription confirmations
  • newsletter_unsubscribe: Manages unsubscriptions
  • newsletter_send: Sends newsletters to all subscribed users (admin access only)

Template Configuration

Configure the template paths by adjusting your twig.yaml file to recognize the NewsletterBundle's templates.

# config/packages/twig.yaml

twig:
    paths:
        '%kernel.project_dir%/src/Bundle/NewsletterBundle/templates': NewsletterBundle

Parameters Configuration

Define custom parameters in your services.yaml file to configure the contact email address.

# config/services.yaml

parameters:
    contact_email: [email protected]

Security Configuration

Secure the administration route by adjusting your security.yaml file.

# config/packages/security.yaml

security:
    access_control:
        - { path: ^/admin, roles: ROLE_ADMIN }

Usage

  • Subscription: Send a POST request to /newsletter/subscribe
  • Confirmation: Redirect users to /newsletter/confirm
  • Unsubscription: Use /newsletter/unsubscribe for unsubscriptions
  • Newsletter Sending (admin only): A POST request to /admin/newsletter/send sends newsletters

Contributing

Contributions are always welcome! To contribute:

  • Fork the project
  • Create a branch for your modifications
  • Submit a Pull Request

Support

Should you encounter issues or have questions, feel free to open an issue on GitHub.

License

This project is licensed under the terms of the MIT License. For more information, please refer to the file.

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.