Sobes.tech
Middle

func buildOrderEmailBody(items []Item, totalPrice float64) string { body := "Tänan tellimuse eest!\n\n" body += "Siin on teie tellimuse üksused:\n" for _, } func CreateOrder(customerEmail string) { totalPrice := ListAndCalculateVAT() orderDetails := "Tänan tellimuse eest!\n\n" orderDetails += "Siin on teie tellimuse üksused:\n" for _, item := range items { orderDetails += fmt.Sprintf("- %s: $%.2f\n", item.NameOfProduct, item.PriceOfProduct) } orderDetails += fmt.Sprintf("\nKokku (koos KM-ga): $%.2f\n", totalPrice) order = Order{Items: items, EmailSent: false} subject := "Teie tellimuse kinnitamine" if err := SendOrderConfirmationEmail(customerEmail, subject, orderDetails); err != nil { }