SaaS CMS has officially launched! Learn more now.

CMS v11.30 - Accessing personalized rich text content via scheduled job

Vote:
 

Hi, 

I have an issue that I'm hoping someone will be able to help me with. 

I have an issue with a scheduled job that runs and generates an XML file of the product data in the catalog.

As part of that XML content, each products description content (rich text field) is added. 

This has always worked fine, as previously there has been no personalization rules applied to that rich text field. 

Recently the content has been updated to apply personalization rules - the visitor group its using is one that identifies B2C customers (the criteria is basically any visitor that doesn't identify as B2C!).

If I debug the scheduled job locally, as it runs, I can see that from the fragments inside the rich text field, once filtered I don't get any content back - I know this is related to the context under which the job runs, but even if I add personalization to the field which relates to a visitor group with criteria: Role = Everyone, I still don't see that fragement when the job runs. 

Can you not get any personalized content within the context of a scheduled job? 

Thanks,

Paul 

#258566
Jul 07, 2021 11:08
Ha Bui - Jul 07, 2021 13:27
By the way I think this question is more related to Commerce instead?
Vote:
 

Hi Paul,

Could you please provide some pices of your export commerce content code?

I prefer to use CatalogImportExport  ...

#258570
Jul 07, 2021 13:26
Vote:
 

Hi There, 

Thanks for the reply. The reason for the scheduled job is to build XML for a feed, its not for the purpose of exporting product information. 

Its also a solution that I've inherited and its been around for a while so the scope to refactor it is minimal unfortunately. 

Even though the job specifically looks at loading product content from commerce, this issue isn't specific to commerce - it still applies to CMS content - if a rich text field contains personalized content, whether its a CMS page or a product, the result is the same unfortunately. 

Thanks,

Paul 

#258572
Jul 07, 2021 13:41
Vote:
 

This is not my area of expertise but I don't think you can. Visitor group relies on HttpContext to determine which visitor group the current user is in. And scheduled job has no HttpContext. You can set one, but I'm not sure if that will work 

#258577
Jul 07, 2021 19:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.