catcher_modules.marketing package¶
Submodules¶
catcher_modules.marketing.marketo module¶
-
class
catcher_modules.marketing.marketo.
Marketo
(**kwargs)[source]¶ Bases:
catcher.steps.external_step.ExternalStep
Allows you to read/write/delete leads in Adobe Marketo marketing automation tool.
Config: - munchkin_id: mailserver’s host
- client_id: mailserver’s host. Optional. Default is 993.
- client_secret: your username
Read: read lead record from Marketo - conf: config object
- fields: fields to retrieve
- filter_key: field to use for filtering. Optional. Default is email.
- filter_value: list or single value used in filtering
Write: write lead record to Marketo - conf: config object
- action: ‘createOnly’, ‘updateOnly’, ‘createOrUpdate’, ‘createDuplicate’
- lookupField: field to use as a key, for updating. Optional. Default is email.
- leads: list of dicts to write to Marketo
Delete: delete lead from Marketo - conf: config object
- by: field name by which lead will be deleted
- having: list or single value
Examples: Read lead by custom_id field
marketo: read: conf: munchkin_id: '{{ marketo_munchkin_id }}' client_id: '{{ marketo_client_id }}' client_secret: '{{ marketo_client_secret }}' fields: ['id', 'email', 'custom_field_1'] filter_key: 'custom_id' filter_value: ['my_value_1', 'my_value_2'] register: {leads: '{{ OUTPUT }}'}
Update leads in Marketo by custom_id
marketo: write: conf: munchkin_id: '{{ marketo_munchkin_id }}' client_id: '{{ marketo_client_id }}' client_secret: '{{ marketo_client_secret }}' action: 'updateOnly' lookupField: 'custom_id' leads: - custom_id: 14 email: 'foo@bar.baz' custom_field_1: 'some value' - custom_id: 15 email: 'foo2@bar.baz' custom_field_1: 'some other value'
Delete all leads with emails
marketo: delete: conf: munchkin_id: '{{ marketo_munchkin_id }}' client_id: '{{ marketo_client_id }}' client_secret: '{{ marketo_client_secret }}' by: 'custom_id' having: ['my_value_1', 'my_value_2']