Download the PHP package remp/mailer-skeleton without Composer
On this page you can find all versions of the php package remp/mailer-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download remp/mailer-skeleton
More information about remp/mailer-skeleton
Files in remp/mailer-skeleton
Package mailer-skeleton
Short Description REMP Mailer Skeleton
License MIT
Homepage https://remp2030.com
Informations about the package mailer-skeleton
REMP Mailer Skeleton
This is a pre-configured skeleton of REMP Mailer application with simple installation.
Mailer serves as a tool for configuration of mailers, creation of email layouts and templates, and configuring and sending mail jobs to selected segments of users.
Installation
Docker
The simplest possible way is to run this application in docker containers. Docker Compose is used for orchestrating. Except of these two application, there is no need to install anything on host machine.
Recommended (tested) versions are:
- Docker - 24.0.4
- Docker Compose - 2.19.1
Steps to install application within docker
-
Get the application
A) Using Composer:
B) Using GitHub:
-
Prepare environment & configuration files
No changes are required if you want to run application as it is.
Note: nginx web application runs on the port 80. Make sure this port is not used, otherwise you will encounter error like this when initializing Docker:
In such case, change port mapping in
docker-composer.override.yml
. For example, the following setting maps internal port 80 to external port 8080, so the application will be available at http://mailer.press:8080. -
Setup host
Default host used by application is
http://mailer.press
. This domain should by pointing to localhost (127.0.0.1
), so add it to local/etc/hosts
file. In addition, we recommend addingmailhog.mailer.press
domain for testing. Use the following commands: -
Start Docker containers
You should see logs of starting containers. This may include errors, because application was not yet initialized. Enter the application docker container:
When inside the container, add required permissions:
After that, choose and run one of the two installation options:
-
Fully ready application with demo data:
- No demo data:
-
-
Log-in to Mailer
Access application via web browser. Default configuration:
- URL: http://mailer.press/
- User:
- Email:
[email protected]
- Password:
passphrase_change_me
- Email:
IMPORTANT: Please run
make install
every time you update Mailer-skeleton usingcomposer update
.
Manual installation
Dependencies
- PHP 8.1
- MySQL 8
- Redis 6.2
Installation
Clone this repository, go inside the folder and run the following to create configuration files from the sample ones:
Edit .env
file and set up all required values such as database and Redis connections.
Now run the installation:
As an alternative, run the following to include seeding of demo values in the installation:
Mailer demo overview
Default integrations
After the installation of Mailer skeleton, Mailer uses default (local) integrations that need to be replaced with real implementations before going live. The local integrations serve as references and defaults to allow sending testing emails without doing any extra work.
Authentication
SimpleAuthenticator
is responsible for authentication to the tool.
List of credentials is configured in config.local.neon
file. Default credentials are:
- Email:
[email protected]
- Password:
passphrase_change_me
Do not run Mailer publicly with SimpleAuthenticator
using the default credentials.
Mailers integration
Outgoing emails are sent by SmtpMailer
. To configure a different mailer (e.g. MailGun), consult the Mailers section in the documentation.
Configuration of the SMTP mailer is loaded from config.local.neon
, see the section local_configs
(which overrides any configuration options stored in the database):
Key remp_smtp_host
points to mailhog
. This is an internal docker address of the mailhog docker container. The container runs MailHog, which is a web based SMTP testing tool.
Therefore, all emails sent from the Demo Mailer instance are captured by MailHog, and are easily viewable in the MailHog web interface at http://mailhog.mailer.press.
User-base integration
Mailer depends on external authority to get information about users. As a default source of users, Dummy
implementation of user provider is used. Provider lists 2 demo users ([email protected], [email protected]).
See the documentation on how to implement different user provider.
Segment integration
To send a newsletter, Mailer needs to get a segment of users who should receive it. To complement default user-base integration, there's also Dummy
implementation of segment provider, always returning the same segment with both demo users.
Debug mode
After the installation, Mailer is running in debug mode and all debug information is shown. Avoid running this mode in production. To disable this mode, change the value of ENV
key in .env
configuration file:
Basic scenario - send email to user segment
To test the Mailer functionality, we recommend going through the following basic scenario:
- Log-in to Mailer at URL http://mailer.press
- Go to Jobs
- Click Add new job
- Select values in Include segments, Newsletter list, and Email A alternative inputs. Keep other inputs empty.
- Demo values of Emails, Layouts and Newsletter lists are seeded by default in demo installation.
- Click Save and start button
- Wait approximately a minute, so Mailer processes the job. Check the job status at Jobs page.
- After the job is processed (status "DONE"), go to MailHog at http://mailhog.mailer.press/ and check that emails were successfully received.
Customization
Mailer-skeleton is ready for customization. Please see the mailer-module documentation for more information.
As a sample, mailer-skeleton provides app/Commands/SampleCommand.php
, extending the Command
class.
It is registered as a new command in the config.local.neon
file. Run it by connecting to the container:
and executing the command:
Troubleshooting
Some known errors that have occurred and how to fix them.
Docker SMTP error "Cannot assign requested address"
In some cases (such as running containers for the first time), a docker container might end up reporting this error message. Simply restarting the problematic container should help.