let me start by admitting that I'm super new to Salesforce (both marketing cloud and SalesForce CRM). So please don't assume I might already know something in your answers.
Here is what I have set up so far:
Whenever a "Job" (Salesforce CRM Object) is inserted, I have an APEX trigger that can execute code after the insert ("After Trigger"). Jobs have tons of fields, like what "State" they are in, and "Min Compensation $", "Max Compensation $", etc. (typical stuff that makes up normal Job entities in probably any system).
Now, I also have tons of "Contacts". These Contacts have some custom fields attached (job preferences), such as which State they live in, how much money they'd like to make at a job, types of jobs they are interested in (IT, Culinary, legal, Teaching, etc.)
I have a SalesForce marketing cloud business unit set up, with the SFMC Connector to my SalesForce CRM account. I should be able to sync any SF Cloud data (such as Contacts and Jobs).
Here is my objective:
So with that preface, here is what I'd like to accomplish, with your help. Right after a new job is inserted in SalesForce CRM, I'd like to send an email to all of my Contacts, which have matching "Job Seeker" criteria with that newly added job, using SalesForce Marketing Cloud.
Example: So, right after I insert a "Job" in say... Maryland, that is for a Teacher position paying $50k, then I'd like to send an email (using SF Marketing Cloud) to all my Contacts that live in Maryland, are interested in Teaching positions, and want to make $50k.
I've seen that SFMC offers Triggered sends. But I can't seem to get passed the fact that I don't know ahead of time what group of audience should get the email. Who receives the email is based on the fields on the newly inserted Job. Likewise, details about the new job need to appear in the email template.
All the examples I see online are when you already know what users should receive the email in a filtered data extension, and they use AMPScript to lookup records that have a related ID.
I'm not sure what is possible?
- Perhaps it's possible for me to insert the Job, then run SoQL to get all Contacts with matching criteria, and then somehow pass all of those contacts and the particular job data to SFMC, to some template?
For instance, after inserting the new Job, I could query the database for all contacts which have a "State" matching "NewJob.State". But how would I get all of those Contact result AND the Job data over to SFMC?
- Perhaps it's possible for me to insert the Job, then pass just that Job record to SFMC, and within SFMC run some SoQL on the data extension to determine who should receive the email, and then still use that Job record for the email template.
The important thing is that, if I don't pass the new "Job" record from SF CRM to SFMC, then how can SFMC know which job recommendation should be placed into the email template, and used for filtering contacts.
I hope this was detailed enough to convey my objective. Thanks!