I am using Loopback 3, with it's user registration and authentication enabled.
In the system that I have to work with, they "send" emails by adding entries into an "email_queue" table. The table has fields like "to", "from", "subject", "body", "send_at_time" etc.
Then, there is a cronjob that checks for new entries each minute, and sends the email through some internal email process.
Thus, in loopback's /server/datasources.json file, I need to figure out how to connect to a mysql database, and insert a row rather than use "connector": "mail" which is what I have used in other systems.
In other words, how do I change this (and maybe other files, as needed):
{
"emailDs": {
"name": "emailDs",
"connector": "mail",
"transports": [
{
.... etc ...
... so that instead of sending emails for user registration, password reminders, etc. loopback inserts rows into a database table to "send" the emails.
You might try using the MySQL connector
with an updated datasource config for the db (docs are here)-
lb datasource emailDS
and then in the datasources config -
{
...
"emailDS": {
"name": "emailDS",
"connector": "mysql",
"host": "example.target.com",
"port": 3306,
"database": "target-mysql-db",
"username": "user",
"password": "L00pBack"
}
}