Add a block of jobs to the daily digest that is relevant to user based on settings in their profile

The idea is to add a block of jobs to the daily digest that is relevant to users based on settings in their profile. My first idea is to develop a plugin where I could access and modify the digest email and include the block that I need

Here is the endpoint, the idea is to grab the user location, and make a query passing it as parameters:
https://api.get.it/api/v1/listings/jobs/search/?limit=1&search=sales&city=Alexandria&state=VA

That is a representation of the job, the blue area already exists on the digest email, and we want to implement the job list (yellow area)

So far Im trying to implement these two ideas:
The first idea is to customize via user_notifications.digest.custom.html:

  • I know the user_notifications.digest.custom.html file can be used to modify the digest email in the UI.
  • I want to investigate if I can use a plugin to access a file of this type which I believe may be the best approach

The second idea, I noticed some siteā€™s text uses ā€˜variablesā€™

If I can create this type of variable like {jobtitle} and make it dynamically I could add this in the custom.html

Questions:

The goal of this work is to add a block of jobs (coming from API response) to the daily digest that is relevant to the user based on settings in their profile

Any suggestions or ideas are welcome. Thank you in advance!

1 Like

Oh. Funny. I was going to link to that. Iā€™m pretty sure that itā€™s still working. (!)

Iā€™d start with a clean skeleton and add stuff to it as youā€™re sure you need it. I wrote that a long time ago and Discourse has changed and I wasnā€™t very good at writing plugins then. :slight_smile:

Iā€™d also look for examples that use Discourse.cache so that youā€™re not needlessly pulling the same jobs from the API over and over again.

2 Likes

Your feature request should also be mentioned:

2 Likes