How to use a webhook to pull data from our database for a program my.Token? | Community
Skip to main content
March 11, 2016
Question

How to use a webhook to pull data from our database for a program my.Token?

  • March 11, 2016
  • 1 reply
  • 3172 views

As the title says, we are trying to setup an email campaign. The campaign should get new content for the tokens in the body of the email, and then send the updated email.

How should we do this? Can we?

We are OK on our side with the API and everything, we are just not sure how best to create the webhook, and how to get it to map the response from our database to myEmailContent tokens in the email template.

Thanks,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Grégoire_Miche2
Level 10
March 11, 2016

Hi Issa,

You will need 2 smart campaigns in fact:

  1. The web hook call the external web service. When the value is returned the webhook updates the lead field. Remember webhooks are asynchronous. This means you cannot know how long it will take to return the value and update the field.
  2. So you will need to use a second smart campaign that triggers on a "data value changes" on the updated lead field, sends the email and wipes out the updated lead field (in case you want to run it again).

-Greg

March 11, 2016

Hi, thank you.

So, what this sounds like is that we can only update Lead and System tokens, not custom Program tokens?

Setting aside the Webhook. Is there ANY way we can have a campaign update the content in a body of an email at the time of send?

I.E. A daily email - When we hit "run once" in the dashboard, the program should request the data for the tokens, fill in the email template, and send.

But my understanding is that we cannot pull the custom tokens in this way - they must be pushed from the external system into Marketo, and when that happens, the external push inherently has to trigger a send immediately. Is this correct?

Any thoughts?

Issa

March 11, 2016

And when I say "get the content for the tokens" I'm referring to program tokens. I've setup the email to retrieve all it's content from our database.

Thanks,