Library
Module
Module type
Parameter
Class
Class type
This module provides the email service and the email template service.
The email service provides API for sending emails. Currently SMTP and Sendgrid are supported.
First, decide for a backend in service/service.ml
:
module Email = Sihl_email.SMTP
Then, register the service in run/run.ml
:
let services = [ Service.Email.register () ]
Run make sihl
to get a list of required configurations.
The API is documented in Sihl.Contract.Email.Sig
.
The template service can be used to create and edit email templates. Email templates are rendered with parameters to emails, that can be sent with the email service
. Currently MariaDb (Sihl_cache.MariaDb
) and PostgreSql (Sihl_cache.PostgreSql
) are supported.
First, decide for a backend in service/service.ml
:
module Email_template = Sihl_email.Temlate.PostgreSql
Then, register the service in run/run.ml
:
let services = [ Service.Email_template.register () ]
Run make sihl migrate
to run pending migrations.
The API is documented in Sihl.Contract.Email_template.Sig
.