Mailer & SMS

Configure SMTP and Twilio so that Spica can send verification codes, magic links, password resets and passwordless logins by email and SMS.

Spica sends email and SMS for the user flows of the Passport module: email and phone verification, password reset and passwordless login. Configure the channels with startup options.

Email (SMTP)

OptionDescription
--mailer-hostSMTP server, for example smtp.sendgrid.net.
--mailer-portSMTP port, for example 587.
--mailer-secureUse TLS from the start (port 465). Default false, which still upgrades with STARTTLS when the server offers it.
--mailer-user, --mailer-passSMTP credentials.
--mailer-fromDefault sender, for example "Acme <no-reply@acme.com>".
Terminal
--mailer-host=smtp.sendgrid.net --mailer-port=587 \
--mailer-user=apikey --mailer-pass=$SENDGRID_API_KEY \
--mailer-from="Acme <no-reply@acme.com>"

SMS (Twilio)

OptionEnvironment variable
--sms-sender-strategy=twilio
--twilio-sms-service-account-sidTWILIO_ACCOUNT_SID
--twilio-sms-service-auth-tokenTWILIO_AUTH_TOKEN
--twilio-sms-service-from-numberTWILIO_FROM_NUMBER

Prefer the environment variables for credentials. The Helm chart reads them from application.twilioAccountSid, application.twilioAuthToken and application.twilioFromNumber.

What users receive

StrategyEmailSMS
OtpSubject Spica verification code, text Your verification code is: 123456Your verification code is: 123456
MagicLinkVerify your email by clicking this link: <link>Verify your phone by clicking this link: <link>

Magic links point to <public-url>/passport/user/verify-magic-link?token=..., so --public-url must be reachable by your users.

Sending other messages

The mailer and SMS sender don't have a public API. To send your own emails or texts, for example order confirmations, call your provider from a function, with its credentials stored as secrets.