implement email queue
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/aws/aws-sdk-go-v2/service/ses/types"
|
||||
)
|
||||
|
||||
func ResetUserEmail(userEmail Email, customerId CustomerId) error {
|
||||
func ResetUserEmail(userEmail UserEmail, customerId CustomerId) error {
|
||||
// Load AWS configuration
|
||||
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"))
|
||||
if err != nil {
|
||||
@@ -29,7 +29,7 @@ func ResetUserEmail(userEmail Email, customerId CustomerId) error {
|
||||
|
||||
// Define email subject and body
|
||||
subject := "nKode Reset"
|
||||
htmlBody := fmt.Sprintf("<h1>Hello!</h1><p>Click the link to reset your nKode.</p><a href=\"http://%s?token=%s\">Reset nKode</a>", FrontendHost, nkodeResetJwt)
|
||||
htmlBody := fmt.Sprintf("<h1>Hello!</h1><p>Click the link to reset your nKode.</p><a href=\"%s?token=%s\">Reset nKode</a>", FrontendHost, nkodeResetJwt)
|
||||
|
||||
// Construct the email message
|
||||
input := &ses.SendEmailInput{
|
||||
@@ -56,6 +56,6 @@ func ResetUserEmail(userEmail Email, customerId CustomerId) error {
|
||||
}
|
||||
|
||||
// Output the message ID of the sent email
|
||||
fmt.Printf("Email sent successfully, Message ID: %s\n", *resp.MessageId)
|
||||
fmt.Printf("UserEmail sent successfully, Message ID: %s\n", *resp.MessageId)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user