KScript docs
EN

Mail: KScript.Mail

Introduction

Most apps send email: a welcome message, a receipt, a link to reset a password. KScript.Mail sends it with one command, @send_mail. Where the mail goes is a setting, not code: while you build, every message is written to the log; in production, it goes through your SMTP server; in tests, a fake keeps it so you can check it.

<import package="KScript.Mail" />

<do>@send_mail(to: 'joan@example.com', subject: 'Welcome to the shop', text: 'Thanks for signing up.')</do>
import KScript.Mail

@send_mail(to: 'joan@example.com', subject: 'Welcome to the shop', text: 'Thanks for signing up.')

With no settings, that message is written to the log, so you can see what would have been sent.

Edit this page on GitHub