Hi,
For a customer I was always using SendGrid but since that support’s been dropped I am switching to Mailgun.
I made a mailgun account + domain and set the .env vars to the new mailgun settings.
PS: I do the mailing through a flfow which triggers when a contact item is posted. This worked with SendGrid too.
version: '3'
services:
database:
container_name: database
image: postgis/postgis:13-master
# Required when running on platform other than amd64, like Apple M1/M2:
# platform: linux/amd64
volumes:
- ./data/database:/var/lib/postgresql/data
networks:
- directus
environment:
POSTGRES_USER: 'directus'
POSTGRES_PASSWORD: ''
POSTGRES_DB: 'directus'
cache:
container_name: cache
image: redis:7
networks:
- directus
directus:
container_name: directus
image: directus/directus:latest
ports:
- 8055:8055
volumes:
# By default, uploads are stored in /directus/uploads
# Always make sure your volumes matches the storage root when using
# local driver
- ./uploads:/directus/uploads
# Make sure to also mount the volume when using SQLite
- ./database:/directus/database
# If you want to load extensions from the host
- ./extensions:/directus/extensions
networks:
- directus
depends_on:
- cache
- database
environment:
KEY: ''
SECRET: ''
PUBLIC_URL: 'my-url'
MAX_PAYLOAD_SIZE: '20mb'
DB_CLIENT: 'pg'
DB_HOST: 'database'
DB_PORT: '5432'
DB_DATABASE: 'directus'
DB_USER: 'directus'
DB_PASSWORD: ''
CORS_ENABLED: "true"
CORS_ORIGIN: "true"
CACHE_ENABLED: 'false'
CACHE_STORE: 'redis'
CACHE_AUTO_PURGE: 'true'
CACHE_REDIS: 'redis://cache:6379'
EMAIL_TRANSPORT: 'mailgun'
EMAIL_MAILGUN_API_KEY: 'MY-API-KEY'
EMAIL_MAILGUN_DOMAIN: 'mg.domain.nl'
EMAIL_MAILGUN_HOST: 'api.eu.mailgun.net'
EMAIL_FROM: 'Customer Contact <noreply@mg.customer-site.nl>'
ADMIN_EMAIL: 'my-self'
ADMIN_PASSWORD: 'nope'
With cURL it works:
curl -s --user 'api:API_KEY' \
https://api.eu.mailgun.net/v3/mg.domain.nl/messages \
-F from='Mailgun Sandbox <postmaster@mg.domain.nl>' \
-F to='name <contact@domain.nl>' \
-F subject='Hello named' \
-F text='Congratulations name, you just sent an email with Mailgun! You are truly awesome!' \
But the mail simply doesn’t send. I also don’t get error messages or so.
How can I fix this?
