mirror of
https://github.com/hanzoai/marketing.git
synced 2026-10-17 11:18:15 +00:00
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]>
25 lines
536 B
Go
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)
|
|
}
|