What I am trying to accomplish: let Salesforce trigger the sending of a Pardot email template to a Pardot prospect. This in itself can be done quite easily using the Pardot API.
However, the Pardot email template uses some fields, which are shared between Salesforce and Pardot. Just before sending the email, Salesforce has changed the fields. So it is necessary that Pardot syncs with CRM before sending the email.
The changes in Salesforce are not synced in real time, the syncing is done in batches, periodically. There is a button "Sync with CRM" on the prospect page. How can I click on that button using the Pardot API? How can I force syncing?
The alternative would be to delay the sending of the mail, until the syncing has taken place. I don't know yet how often this is done.