Token-based email templates sent through cbmailservices.
On this page
Email templates use cbmailservices with simple @token@ placeholders, replaced at send time:
<h1>Reset Your Password</h1>
<p>Click the link below to reset your password:</p>
<a href="@linkToken@">Reset Password</a>
<p>This link expires @expiration@.</p>
Sent from a service call:
mailService.newMail()
.config( from = "noreply@app.com", to = user.getEmail(), subject = "Reset Password" )
.setBodyTokens( { linkToken: resetLink, expiration: "in 60 minutes" } )
.setBodyTemplate( "password_verification" )
.send();
Templates shipped
| Template | Sent when |
|---|---|
user_welcome.bxm | A new account is created |
registration_verification.bxm | A new account needs email verification |
password_verification.bxm | A password-reset link is requested |
password_reset.bxm | Confirmation after a password change |
email_change_confirmation.bxm | A user requests an email change - sent to the new address to confirm it |
email_change_notice.bxm | A user requests an email change - sent to the old address as a heads-up |
Protocol by environment
In development, app/config/modules/cbmailservices.bx writes outgoing mail to disk instead of sending it - nothing leaves your machine while you're building. Configure a real SMTP provider (Postmark, SendGrid, or plain SMTP) for production - see Deployment.