22 lines
519 B
Go
22 lines
519 B
Go
package orderStatusActions
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.ma-al.com/goc_daniel/b2b/app/model/enums"
|
|
)
|
|
|
|
func init() {
|
|
var sendNewOrderEmail = WithID("send_new_order_email", func(actionCtx ActionContext) ActionResult {
|
|
|
|
if actionCtx.EmailService == nil {
|
|
return ActionResult{Err: fmt.Errorf("emailService not provided")}
|
|
}
|
|
return ActionResult{Err: actionCtx.EmailService.SendNewOrderPlacedNotification(*actionCtx.UserId)}
|
|
})
|
|
|
|
GlobalRegistry.Register(enums.OrderStatusPending, ActionChain{
|
|
sendNewOrderEmail,
|
|
})
|
|
}
|