mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
21 lines
492 B
Go
Executable File
21 lines
492 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/micro/services/clients/go/email"
|
|
"os"
|
|
)
|
|
|
|
// Send an email by passing in from, to, subject, and a text or html body
|
|
func SendEmail() {
|
|
emailService := email.NewEmailService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := emailService.Send(&email.SendRequest{
|
|
From: "Awesome Dot Com",
|
|
Subject: "Email verification",
|
|
TextBody: `Hi there,
|
|
|
|
Please verify your email by clicking this link: $micro_verification_link`,
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|