func buildOrderEmailBody(items []Item, totalPrice float64) string {
body := "Obrigado pelo seu pedido!\n\n"
body += "Aqui estão os itens do seu pedido:\n"
for _,
}
func CreateOrder(customerEmail string) {
totalPrice := ListAndCalculateVAT()
orderDetails := "Obrigado pelo seu pedido!\n\n"
orderDetails += "Aqui estão os itens do seu pedido:\n"
for _, item := range items {
orderDetails += fmt.Sprintf("- %s: $%.2f\n", item.NameOfProduct, item.PriceOfProduct)
}
orderDetails += fmt.Sprintf("\nTotal (incluindo IVA): $%.2f\n", totalPrice)
order = Order{Items: items, EmailSent: false}
subject := "Confirmação do seu pedido"
if err := SendOrderConfirmationEmail(customerEmail, subject, orderDetails);
err != nil {
}