Giter VIP home page Giter VIP logo

company-mailer's Introduction

Company Mailer

Objectif : rédiger et envoyer des mails à des entreprises (fictives) répertoriés sur l'application

Démarrer le projet

  • cloner le repo
git clone https://github.com/samihanine/company-mailer
  • importer la bdd depuis le fichier : companymail.sql
  • modifier le .env
DATABASE_URL="mysql://root:[email protected]:8889/companymail"
MAILER_DSN=gmail://[email protected]:totoro2021@default
  • démarrer le serveur :

php -S 127.0.0.1:8000 -t public ou symfony server:start

http://127.0.0.1:8000

Packages

  • Pour utiliser des fonctionnalités avec commentaires :

composer require annotations

  • Pour utiliser des templates html :

composer require twig

  • Pour utiliser une BDD :

composer require symfony/orm-pack

composer require --dev symfony/maker-bundle

  • Gestion des assets (css/image/js) :

composer require symfony/asset

  • Envoyer des mails :

composer require symfony/mailer

composer require symfony/google-mailer

  • Authentification

composer require symfony/security-bundle

composer require symfonycasts/verify-email-bundle

BDD

  • Dans le fichier .env :
DATABASE_URL="mysql://root:[email protected]:8889/companmailer"
  • créer la BDD avec doctrine
php bin/console doctrine:database:create

php bin/console make:entity

php bin/console make:migration  
php bin/console doctrine:migrations:migrate

Utiliser des assets

  • Mettre les assets dans le dossier public
<link href="{{ asset('css/blog.css') }}" rel="stylesheet"/>
  • Désactiver le cache (pour le css) dans config/packages/twig.yaml
twig:
    cache: false

Envoyer un mail avec gmail

Auth / register

composer require symfonycasts/verify-email-bundle

php bin/console make:user

php bin/console make:auth

php bin/console make:registration
  • limiter l'accès aux routes (avec annotation)
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;

/* ... */

/**
* @Route("/mail/{id}", name="mail_create")
* @IsGranted("ROLE_USER")
*/

company-mailer's People

Contributors

samihanine avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.