This guide covers how to dynamically send emails in the Minds backend.
- An event occurs (e.g. a new user joins Minds) and dispatches a message to the queue
- The queue then dispatches an internal event
- The internal event compiles and dispatches the email
- Mailer.php does the actual sending
You can also use/extend optional EmailStyles.php and partials (reusable snippets that get built and injected into the email) for additional control over styles. See SuggestedChannels.php and SuggestedChannels.tpl for partial usage examples.
See email-related CLI controllers for tools related to testing and building.
To actually send and test, add your own SMTP server to
$CONFIG->set('email', [ 'smtp' => [ 'host' => 'smtp.gmail.com', 'username' => 'my username', 'password' => 'my password', 'port' => 465 ] ]);
Make sure runners are running so the queue can be parsed:
docker-compose up runners