campaigns

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2018 License: AGPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCampaignEvent

func HandleCampaignEvent(mr *mailroom.Mailroom, task *queue.Task) error

HandleCampaignEvent handles campaign event fires. For each event:

  • loads the event to fire
  • loads the org asset for that event
  • locks on the contact
  • loads the contact for that event
  • creates the trigger for that event
  • runs the flow that is to be started through our engine
  • saves the flow run and session resulting from our run

func StartCampaignCron

func StartCampaignCron(mr *mailroom.Mailroom) error

StartCampaignCron starts our cron job of firing expired campaign events

Types

type EventFire

type EventFire struct {
	FireID       int               `db:"fire_id"`
	Scheduled    time.Time         `db:"scheduled"`
	Fired        *time.Time        `db:"fired"`
	ContactID    models.ContactID  `db:"contact_id"`
	ContactUUID  flows.ContactUUID `db:"contact_uuid"`
	EventID      int64             `db:"event_id"`
	EventUUID    string            `db:"event_uuid"`
	CampaignID   int64             `db:"campaign_id"`
	CampaignUUID string            `db:"campaign_uuid"`
	CampaignName string            `db:"campaign_name"`
	OrgID        models.OrgID      `db:"org_id"`
	FlowUUID     flows.FlowUUID    `db:"flow_uuid"`
}

EventFire represents a single campaign event fire for an event and contact

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL