We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

[SOLVED] Please Help Me! I'm New To The EE And Need To Integrate It With Salesforce Marketing Cloud

How Do I?

Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

What I should do, when a new news page is added, should trigger an event that will send an API request with news page name and news page content. I should receive that content from EE and put that data in my HTML string and after that send it. The same for the news page updated. I found that article in the documentation but I never worked with PHP and EE before and not sure where to paste it. Please help ASAP! Thank You!

https://docs.expressionengine.com/latest/development/extension-hooks/cp/publish.html#entry_save_and_close_redirectentry

       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

Sorry for the capitalized letters guys! Can’t change them

       
vw000's avatar
vw000
241 posts
4 years ago
vw000's avatar vw000

You want to post some news in EE that then executes an API posting it to SalesForce? Or the other way around? From SalesForces to EE?

👍 1
       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

Yes, the first one. I should set up news automation for SF Marketing Cloud. Whenever a company creates new news on the EE, I should send this data to the SFMC, but before put that content in my HTML CSS container. LIke: ‘<style> div {color: red;}</style><div>NEWS CONTENT WILL BE THERE</div>’, it will be a simple string;

       
Andy McCormick's avatar
Andy McCormick
183 posts
4 years ago
Andy McCormick's avatar Andy McCormick

It sounds like what you want is actually the after_channel_entry_save hook https://docs.expressionengine.com/latest/development/extension-hooks/model/channel-entry.html#after_channel_entry_saveentry-values.

If you’re unfamiliar with creating an extension. Here is a starter one for you that I generated from https://ee-addon-generator.triplenerdscore.xyz/ : https://drive.google.com/file/d/1tzhleikgP2XY9-QK2OzGyMpemZniC8ZS/view?usp=sharing

You’ll want to capture the entry data after it’s saved, do whatever you want to it in your PHP (ie. putting it into an HTML formatted string), and push that to your SalesForce API endpoint.

👏 2 👊 1 👍 1 💯 1
       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

Oh my god, thank you a lot man! Currently, I have almost 00:00 and I will start to develop it in the next 10 hours I guess. But the article which you send me and the code snippet is amazing, thank you again! I’ll write you back for updates.

       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

I reviewed the files and have 2 questions: - In which folder I should put these 2 files and in that function, I will have data, whenever the hook will be triggered? - How to debug in EE, I mean see logs and errors;

       
Andy McCormick's avatar
Andy McCormick
183 posts
4 years ago
Andy McCormick's avatar Andy McCormick

so your add-ons go into /system/user/addons assuming no one has changed the name of your system folder. https://docs.expressionengine.com/latest/add-ons/overview.html#installing-add-ons

Next, definitely read through the developing extensions guide here: https://docs.expressionengine.com/latest/development/extensions.html

       
Andy McCormick's avatar
Andy McCormick
183 posts
4 years ago
Andy McCormick's avatar Andy McCormick

Regarding debugging, it’s like any other PHP app. You can use tools like Xdebug if that’s what you like. Especially for extensions I like to just write values to files or die and echo out the values so I can see what data is available. I’m not the best extension developer, but if you have zero time, that might be the best way to start. Dump the $values in the extension, then go into EE and save an entry. You’ll see what’s then available.

Here was a conference talk on using Xdebug with EE.. https://www.youtube.com/watch?v=nxr2XjFfpgs&list=PL5elGX70z1bhTWETdrvbLA5pOPIDEe9c7&index=12

You can also look for free EE add-ons out there and browse them to see how they are using extensions.|

       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

Hi there! I did it, wrote an extension which on update or creates new entry will send data to the SFMC. Now I get stuck on identifying a new entry type, I should do it only on the news. Maybe I can query it by Entry name and identity that is news? Please help me with it. Values coming from hook don’t show me that.

       
dougblackjr's avatar
dougblackjr
7 posts
4 years ago
dougblackjr's avatar dougblackjr

@Andrii, are you trying to get the channel name? Or do you have a field on your entry called type?

👆 1
       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

@dougblackjr I’m trying to get the channel name.

       
dougblackjr's avatar
dougblackjr
7 posts
4 years ago
dougblackjr's avatar dougblackjr

@Andrii

So, if you are using the after_channel_entry_save hook, you should be able to get the Channel off of the entry.

The hook comes in like this:

after_channel_entry_save($entry, $values)

So you should be able to do this.

$channel = $entry->Channel;
$channelName = $channel->channel_name;

You can get the channel ID off of the values and query the model yourself.

$channelId = $values['channel_id'];
$channel = ee('Model')->get('Channel')->filter('channel_id', $channelId)->first();
$channelName = $channel->channel_name;
       
Andrii Hubanov's avatar
Andrii Hubanov
8 posts
4 years ago
Andrii Hubanov's avatar Andrii Hubanov

@dougblackjr It works! Thank you a lot!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.