/* * Hexacode Mailer * Package: gitlab.hexacode.org/go-libs/mailer * Maintainer: Azzis Arswendo * * Copyright (C) 2023 Hexacode Teknologi Indonesia * All Rights Reserved */ package main import ( "gitlab.hexacode.org/go-libs/hctypes" "gitlab.hexacode.org/go-libs/mailer" ) func main() { // Create a new template // Please see https://github.com/noirbizarre/gonja for more details template tmpl, err := mailer.NewTemplate("Hello {{ name }}!") if err != nil { panic(err) } // Create a new sender sender := mailer.NewSender("Example Sender", "example-sender@gmail.com", "password", "smtp.gmail.com", 587, tmpl) // Send an email err = sender.SendEmail("example-recipient@gmail.com", "Example Subject", hctypes.Dict{"name": "John Doe"}) if err != nil { panic(err) } }