Back to questions
Middle
1
func buildOrderEmailBody(items []Item, totalPrice float64) string { body := "Thank you for your order!\n\n" body += "Here are the items in your order:\n" for _, } func CreateOrder(customerEmail string) { totalPrice := ListAndCalculateVAT() orderDetails := "Thank you for your order!\n\n" orderDetails += "Here are the items in your order:\n" for _, item := range items { orderDetails += fmt.Sprintf("- %s: $%.2f\n", item.NameOfProduct, item.PriceOfProduct) } orderDetails += fmt.Sprintf("\nTotal (including VAT): $%.2f\n", totalPrice) order = Order{Items: items, EmailSent: false} subject := "Your Order Confirmation" if err := SendOrderConfirmationEmail(customerEmail, subject, orderDetails); err != nil { }
Companies where asked
Туту