SaaS CMS has officially launched! Learn more now.

Let user subscribe to a page, get emails whenever a page is updated


Hi, we have set up an SMTP server so that users can suscribe to pages and get emails whevener a page has been updated. My question is where users emails are stored? Are they stored in the Optimizely database? 

Jul 03, 2023 7:37

That's a question that will be very specific to your build.  When you say users, are you talking about strict CMS users or website users in general?  Are you using the default Microsoft Identities solution for users that comes with CMS 12 or are you using another authentication method, e.g. Azure Ad?

Jul 03, 2023 13:44

Ah, yes, it's a subscription service for end users, so the users of the website. Let's say I'm creating a web page for posting news pages, articles etc. An end user should be able to subscribe to a page and get emails whenever that page has been modified. No log in is required for the users of the website. So, basically you'll have button on an article page where you can decide to write in your email to get notified whenever a page has been updated. 

Jul 03, 2023 13:48

Yeah there's nothing default that's a very custom requirement a Mark says.

I'd suggest

  1. Database table (User's Email (string), Page ID (int), SendEmail (bool))
  2. UI for subscribing on the front end shown to capture email that captures user's email and page id marking SendEmail as false
  3. Hook in to page publish event via the IContentEvents system then mark all rows with the Page ID as SendEmail true. I'm assuming you use blocks so you will lilely have to check for page content types you want this event to run on as well as the blocks by Getting the references to the Pages the block is used on to see if you need to update.
  4. Create a job that runs regularly that takes care of any marked as SendEmail true and does the sending of the email update (As you don't want to do all that in the IContentEvent as it could cause UI hanging in the CMS) and marks sent or deletes row
Edited, Jul 04, 2023 7:45
Tam Duc Ha Vo - Jul 04, 2023 9:24
Ah, so basically you create your own data store for storing user emails?
For example, DynamicDataStoreFactory.Instance.CreateStore("UserEmails", typeof(Users));
Scott Reed - Jul 04, 2023 12:02
I would never use the DynamicDataStore for anything in Optimizely as it has serious performance flaws. Use Entity Framework to create your own table models and store the data directly so you can make sure it's performance optimized
Mark Stott - Jul 05, 2023 21:21
Just to follow on from Scot's point about the DynamicDataStore, If you don't care about performance, then yeah fine use it if you want. If you have the slightest inkling that performance will matter in any way shape or form, go straight for a custom data table with EF. I've even created custom tables where I expect a number of records in singular digits.

Optimizely pretty much dumps anything that doesn't matter in terms of speed into the DynamicDataStore, including Form Submissions, Best Bets etc. As a table it gets bloated very quickly. One of the performance boosts to Best Bets in Search & Navigation was to cache the data to minimise hits to the Dynamic Data Store.
Scott Reed - Jul 06, 2023 11:11
I'd highlight it's not just performance it's also record count. I've had loading the dynamic data store timeout when the amount of data is too large. So if you have a large customer base who could be subscribing that may be millions of records which could be an issue. DDS isn't great when it's scaled out to large datasets

In addition to Scott's recommendations, you will also need to consider the following for compliance and functionality:

  • Unsubscribe end point to allow a user to click unsubscribe within the email and remove themselves from further notices.
  • Double Opt In Requirements for countries like Germany
  • Consider Text vs Image content balance within automated emails.
    • Some email providers (BT Internet) will block emails where image content exceeds text content by specified margin and it won't even appear in the user's email junk.
Jul 04, 2023 9:02

While I am all for using the platform and doing as much as you can in the system.

If your budget doesn't allow the custom developement there are exisiting solutions out there that do this type of functionality for you.

Jul 04, 2023 16:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.