I'm running MariaDB SQL server on Debian linux, I have phpmyadmin installed. SSMTP is installed and configured so I can send emails from the command line.
I have a simple table, called team_members and every time a new team member is added to the table, a new row with unique ID is created, I would like to know how to send what has been added to the table as an email.
+------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| nickname | varchar(255) | NO | UNI | NULL | |
| first_name | varchar(255) | NO | | NULL | |
| last_name | varchar(255) | NO | | NULL | |
| email | varchar(255) | NO | UNI | NULL | |
| timestamp | timestamp | NO | | current_timestamp() | |
+------------+--------------+------+-----+---------------------+----------------+
I understand that this is possible using a trigger, but I don't really understand how it works.
Could anyone possibly give me an example of how to achieve this.
This table is not going to be updated very often, maybe once a month, so its not going to cause lots of unwanted emails.
Thanks in advance.