david_ex

david_ex

Email newsletter w/ tailored content based on user preferences: how to design?

Hi,

I’m looking for resources (or your ideas/approaches!) on designing the architecture of an email notification system based on user preferences. Essentially, think of a job portal: a typical user won’t be interested in all jobs that get posted, but would want to be notified (say twice a week) for any jobs that match his interests (e.g. remote-friendly Elixir jobs based in the GMT+1 timezone).

Job opportunities will get added to the database (through some external mechanism not relevant here), and users need to be notified about new jobs matching their interests, but they shouldn’t be notified more often than their frequency preferences. How should this be approached? My Google-fu is failing me as the combination of keywords I’ve tried invariably bring up help articles on setting email preferences for various websites/software, or newsletter signup info.

One possibility would be to periodically execute (based on the user’s delivery frequency preference) each user’s job selection query against the subset of new jobs having been added to the DB since last execution for that user (merging all result sets if the user has several filter queries), then generating the email with the matches, and enqueueing it for delivery.

You could also periodically (based on some interval) go through all newly added jobs, see which user preferences they satisfy (by running each user query against the subset), and somehow link the matching new results to a “pending” queue for each user. Then, based on the user’s delivery frequency preference, send out the pending items in an email.

Any other approaches, gotchas, etc. I should be aware of? Or better approaches more suitable to Elixir/OTP? I’m sure many similar systems have been written, so it would be great to be able to read up on those before reinventing the wheel and finding out about design/requirement shortcomings the hard way…

Thanks for reading!

Most Liked

joshtaylor

joshtaylor

I would keep things simple and basically have a scheduler (either Genserver process or quantum, or even a mix script called via cron) that runs every X minutes that will schedule jobs via ecto_job/oban to send emails to users.

Start small and build up.

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
yawaramin
In the Dialyzer docs ( dialyzer — OTP 29.0.2 (dialyzer 6.0.1) ), there is a way to turn off a specific warning for a function: -dialyzer...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement