Files
zeekayandHanzo Dev 1a76145191 Hanzo Marketing: lifecycle email, from one place
The web app for /v1/marketing on api.hanzo.ai (audiences, drip sequences and
their steps, enrollments, campaigns, the send calendar, promos and opt-outs)
and the small Go service beside it. Earlier history is kept privately in
hanzoai/marketing-v1.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-15 11:36:13 -07:00

25 lines
536 B
Go

package engine
import (
"github.com/hanzoai/commerce/datastore"
"github.com/hanzoai/commerce/models/multi"
"github.com/hanzoai/marketing/internal/model"
)
// Create dispatches campaign creation to the appropriate engine.
func Create(db *datastore.Datastore, ci CreateInput) (cmpgn *model.AdCampaign, err error) {
co := CreateOutput{
nil,
[]interface{}{},
}
switch ci.Engine {
default:
if co, err = (DemoEngine{}.Create(db, ci)); err != nil {
return nil, err
}
}
return co.AdCampaign, multi.Create(co.Entities)
}