Every app needs email sending capabilites weather it's for password reset or invitations or whatever - appwrite has everything prepared for it, we just need to use the given options.
Because SMTP servers are hard to setup and maintain, we'll use a third party API to provide our SMTP needs.
Mailgun side settings
Since mailgun is super easy to setup and use, we'll use it as our SMTP provider.
After a successful registration:
- Navigato to sending -> overview
- Select SMTP
- Those are the credits that are needed for us in the later setup
I already reset this password, so no worries about that 😊
After grabbing our settings we need to setup for appwrite:
- Navigate to your installation forlder for me it's in
- Start to edit your
.envin the folder
- After you've edited the file restart the appwrite compose
You'll need to edit:
Optionally you can also edit:
_APP_SYSTEM_EMAIL_ADDRESS - this is the sender's email, for this short example I left as is.
To restart appwrite you first need to stop the containers:
$ docker-compose stop
Then after the containers are stopped - restart it:
$ docker-compose up -d
These commands should be executed from your appwrite installation folder, for me:
Aaand that's it, you've successfully setup email sending for your appwrite. To try out go to your console, select a project, settings and invite a new member for it. After you've sent the email mailgun should show something like this:
You can also read the full instructions about email sending in appwrite docs.
I hope you've found this quick article about email setup useful. 😊