Download the PHP package contaolabs/contao-email-download without Composer

On this page you can find all versions of the php package contaolabs/contao-email-download. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-email-download

E-mail download for Contao

Download for e-mail address – free extension by contaolabs.

Deutsche Anleitung

Visitors enter their e-mail address and receive a download link by e-mail, for example for a PDF, a checklist or a ZIP file. The link expires after a set time and can only be used a few times. The file itself stays protected: it has no public address.

Works with Contao 4.13, 5.3 and 5.7 · PHP 8.1 or newer · MIT license

Features

Requirements

Contao 4.13, 5.3 or 5.7
PHP 8.1 or newer
E-mail a working Contao mailer configuration (MAILER_DSN)
Cron Contao cron (web cron or contao:cron) for deleting old requests

Installation

Contao Manager: search for contaolabs/contao-email-download, install it and update the database. Alternatively upload the ZIP file from the product page under "Upload packages".

Composer:

Setup

  1. Put the file into a non-public folder below files/ (folder setting "Public" not checked). The module shows a notice if the selected file is in a public folder.
  2. Create a module of the type Download for e-mail under Themes → Front end modules and select the file.
  3. Adjust the texts, banner, sender and e-mail text as needed. Empty fields use sensible default texts in the language of the page.
  4. Include the module on a page (content element "Module" or page layout).
  5. Describe the download in your privacy policy (see Privacy).

Module settings

Field Default Description
File – File that is sent as a link. Use a non-public folder.
Link valid for (hours) 72 How long the download link works.
Maximum downloads per link 5 How often the link can be used.
Introduction – Text above the form.
Consent text default text Text next to the required checkbox. Links are allowed, e.g. <a href="{{link_url::12}}">privacy policy</a>. The text is stored with each request.
Button label "Send me the download link"
Success message default text Shown after submitting.
Show info banner off Box above the form with title, text, link and link text.
Sender address / name website administrator / page title Taken from the website root if empty.
Subject / E-mail text default text Placeholders see below. If ##link## is missing, the link is appended.
Delete requests after (days) 90 0 = never delete.

Placeholders in subject and e-mail text

Placeholder Content
##link## Download link (absolute URL)
##file## File name
##expires## Date and time until the link is valid
##max_downloads## Maximum number of downloads
##email## E-mail address of the visitor

How the download works

  1. The visitor submits the form. The module creates a request with a random token and sends the link https://example.com/_email-download/<token>.
  2. On click, the token is checked: does it exist, has it not expired, is the download limit not reached? Then the file is sent as an attachment (Cache-Control: no-store, X-Robots-Tag: noindex).
  3. If the link has expired, has been used up or is unknown, the visitor is redirected back to the form page and sees a notice there. If that page no longer exists, a simple page with HTTP status 410 is shown.

The same e-mail address can request at most 3 links per hour, one IP address at most 10. Additional requests from the same e-mail address see the normal success message, but no e-mail is sent, so the form does not reveal which addresses have been used.

Back end

Content → E-mail downloads lists all requests with e-mail address, date, expiry, downloads and the consent text. The button "Export CSV" downloads all requests as a CSV file (semicolon separated, UTF-8 with BOM).

Customizing the appearance

The default style is neutral and uses CSS variables:

For bigger changes, copy the template mod_cl_email_download into the templates folder of your theme. The stylesheet is bundles/contaolabsemaildownload/email-download.css.

Privacy

Stored per request: e-mail address, time of the request, expiry, number of downloads, the consent text at the time of the request and the page. The IP address is only stored shortened (IPv4 /24, IPv6 /48) and hashed, for the rate limit. Requests are deleted after the configured number of days.

Example for your privacy policy (please adapt it to your website):

If you request a download via our form, we process your e-mail address to send you the download link (Art. 6 (1) (b) GDPR). We store the request with the time and number of downloads and delete it after [X] days.

This extension is not legal advice. If you want to use the addresses for marketing as well, you need a separate consent for that, e.g. an additional newsletter checkbox with double opt-in.

Troubleshooting

Support

Questions and bug reports: GitHub issues or [email protected]. More extensions for Contao and Isotope: contaolabs.de

License

MIT – see LICENSE.


All versions of contao-email-download with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
contao/core-bundle Version ^4.13 || ^5.3
doctrine/dbal Version ^3.3 || ^4.0
symfony/config Version ^5.4 || ^6.4 || ^7.0
symfony/dependency-injection Version ^5.4 || ^6.4 || ^7.0
symfony/http-foundation Version ^5.4 || ^6.4 || ^7.0
symfony/http-kernel Version ^5.4 || ^6.4 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package contaolabs/contao-email-download contains the following files

Loading the files please wait ...