Sobes.tech
Middle

func buildOrderEmailBody(items []Item, totalPrice float64) string { body := "Vielen Dank für Ihre Bestellung!\n\n" body += "Hier sind die Artikel Ihrer Bestellung:\n" for _, } func CreateOrder(customerEmail string) { totalPrice := ListAndCalculateVAT() orderDetails := "Vielen Dank für Ihre Bestellung!\n\n" orderDetails += "Hier sind die Artikel Ihrer Bestellung:\n" for _, item := range items { orderDetails += fmt.Sprintf("- %s: $%.2f\n", item.NameOfProduct, item.PriceOfProduct) } orderDetails += fmt.Sprintf("\nGesamt (inkl. MwSt): $%.2f\n", totalPrice) order = Order{Items: items, EmailSent: false} subject := "Ihre Bestellbestätigung" if err := SendOrderConfirmationEmail(customerEmail, subject, orderDetails); err != nil { }