
func buildOrderEmailBody(items []Item, totalPrice float64) string {
body := "Paldies par jūsu pasūtījumu!\n\n"
body += "Šeit ir jūsu pasūtījuma preces:\n"
for _,
}
func CreateOrder(customerEmail string) {
totalPrice := ListAndCalculateVAT()
orderDetails := "Paldies par jūsu pasūtījumu!\n\n"
orderDetails += "Šeit ir jūsu pasūtījuma preces:\n"
for _, item := range items {
orderDetails += fmt.Sprintf("- %s: $%.2f\n", item.NameOfProduct, item.PriceOfProduct)
}
orderDetails += fmt.Sprintf("\nKopā (ieskaitot PVN): $%.2f\n", totalPrice)
order = Order{Items: items, EmailSent: false}
subject := "Jūsu pasūtījuma apstiprinājums"
if err := SendOrderConfirmationEmail(customerEmail, subject, orderDetails);
err != nil {
}