Goravel – A high-performance, full-featured, and easily extensible Golang devleopment framework. Its coding style is consistent with Laravel, makeing it the top choice for Phpers during the transition.
New feature of the Mail module: It supports directly using view templates to render emial content, enabling developers to create beautiful emails more conveniently. It has been merged into the master branch, thanks to the core developer @kkumar-gcc for the contribution.
Core Features
- Configurable template engine: Supports switching between different template engines through configration.
- Built-in caching mechanism: The template only needs to be parsed once, and subsequent usage directly reads from the cache.
- Thread safey: Supports concurrent use in multiple goroutines.
- Global registry: The template engines will be cached globally to avoid repeated creation.
Usage guide
Create an email template:
<!-- resources/views/mail/welcome.tmpl -->
<h1>Welcome {{.Name}}!</h1>
<p>Thanks for joining {{.AppName}}。</p>
Send the email template:
facades.Mail().
To([]string{"user@example.com"}).
Subject("Welcome").
Content(mail.Content{
View: "welcome.tmpl",
With: map[string]any{
"Name": "Tom",
"AppName": "Goravel",
},
}).
Send()
See details in PR: https://github.com/goravel/framework/pull/1145