dev-master
9999999-devSend daily PDF reports about the application's activity
MIT
The Requires
by Slimen Arnaout
by Haouass Abderraouf
reporting bundle symfony reporting mail reporting
Send daily PDF reports about the application's activity
Send daily PDF reports about the application's activity., (*1)
composer require sbc/auto-reporting-bundle
new SBC\AutomaticReportingBundle\AutomaticReportingBundle(),
Set the configuration:
, (*2)
# AutomaticReportingBundle configuration automatic_reporting: app_name: 'Your applciation name' # will be displayed in the email recipients: ['mail1@site.com', 'mail2@site.com'] # multiple recipients
Call @Report
Annotation in the entities you want to follow:, (*3)
/** * Post * * @ORM\Table(name="post") * @ORM\Entity(repositoryClass="AppBundle\Repository\PostRepository") * * @Report( * dateColumn="creationDate", * reportingName="Poste" * ) */ class Post { ... }
You can also separate result for the same entity using the DifferentiationColumn Annotation:, (*4)
/** * Post * * @ORM\Table(name="post") * @ORM\Entity(repositoryClass="AppBundle\Repository\PostRepository") * * @Report( * dateColumn="creationDate", * differentiationColumn="type", * differentiations={ * @DifferentiationColumn(value="A", reportingName="Post of type A"), * @DifferentiationColumn(value="B", reportingName="Post of type B") * } * ) */ class Post { ... /** * Type of the Post entity * @var string * * @ORM\Column(name="type", type="string", length=255) */ private $type; }
php bin/console reporting:generate
to build and send the reportAfter calling the command the bundle will parse and get all the entities with the @Report
annotation and
count all the rows that being created in the current day using the dateColumn
attribute,
after that the bundle will generate and send a PDF attachment to the recipients containing the summary using the reportingName
attribute for each entity., (*5)
Send daily PDF reports about the application's activity
MIT
reporting bundle symfony reporting mail reporting