Job Alert functionality on ruby on rails app [closed] - ruby-on-rails

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am making a job board and am in the process of making a subscriber list for job seeker who, if willing, can be sent a notification email that the job of their interest has been posted. I have tried google in order to come up with how to start making such functionality but couldn't find something I could use.
I am using sedngrid for sending emails (transactional) which is currently working fine. I wanted to ask how should i make the job alert functionality .
What comes to mind is:
Making a subscriber model
On every Friday night, find all applicants which has subscribed to the job alert.
Find these applicants interests (tags)
Check if any jobs with these tags has been posted in the week.
Send emails to the applicants email.
Is there any gem or gems which give this functionality, or a tutorial?

You don't need gems really.
The Job model will need to have:
belongs_to: location
belongs_to: category
belongs_to: company
belongs_to: salary_range
You might (for simplicity) have the above as plain-attributes instead of separate models. But, I would opt them to be separate models.
Create a model Subscribe that holds the user_id and their interests, say company_id or job_location_id. I rather say, this should be a polymorphic association like :
user_id (integer)
subscribe_type, subscribe_id (links to location/company/job-category)
Write a Cron Job that runs daily/weekly/periodically (use whenever gem) that finds the delta of jobs created from the last-cron-run till date.
Loop on the jobs and find the corresponding subscriptions for its location, job-category, company & etc.
Send emails to the corresponding folks.
While enhancing the app, you will face 2 issues:
Instead of sending one email per every job, is there a way to send one-single-email to the user about all the jobs he is interested in. This is called Email-Digest.
What if any job-details are changed? Should you update the user about the changed-job too?

Related

How to get started with stripe payments with firebase and iOS? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I'm trying to get started with stripe to build out a Patreon like app. I've done a lot of searching and have even started with these docs from Stripe. Unfortunately, I am encountering many problems, probably as a result of a faulty integration.
What I am using:
I am using Firebase database.
Express accounts in stripe
iOS
What I am trying to achieve:
User1 can create a subscription of his chosen price.
User2 can join/pay the subscription.
User1 gets 70% of his money made from the subscription, and I the developer get remainder.
What I have done so far:
Created a Stripe account and set it up at a very base level.
created an Xcode project and included code up until step 2.3
I have setup firebase functions at a base level, and have some code in there from steps up to 2.3 in link above.
What I would like is to have a clear starting point, and path to follow.
How do I get started in achieveing this goal?
Just commenting on the Stripe portion -- what you can do is have a page where your content creators (i.e. User1) can create a Product. Each Product must be tied to a Price:
On another page, retrieve all active Products so content receivers (i.e. User2) can subscribe to it.
Full details can be found at https://stripe.com/docs/billing/prices-guide.
For the revenue splitting, Stripe doesn't seem to support this. Your only option is to do a payout to your business bank account, then further disburse the 70% to your content creators. For this, you must be able to match payment records on Stripe to your database, e.g. design your database in such a way it can answer the SQL query "what is the total amount paid to this particular content creator within a given time period?".

What is the best approach to building an email alert service in rails? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am looking to build a feature where folks can be notified via email when certain content is published on our website. Users would provide their email address, select a few subject areas they are interested in and the frequency in which they want to be updated (daily or weekly).
What is the best practice for building such a system?
I figured I would start with some sort of Subscriptions table (postgres) that would have the following fields:
email
subject_areas (list of IDs?)
frequency (daily/weekly)
last_emailed (timestamp)
I could build a job that would run every night against this table which would hit each row and aggregate all content that matches the subject_areas they were interested in, generate the email and throw it into a 3rd party email service like Mandrill or Amazon.
Does this seem like a good approach or is there a better way to tackle this?
The tables would likely be:
Users (email, name)
Subjects
Subscriptions (user_id, subject_id, last_emailed, frequency)
The other part you want is a background job queuing system (delayed_job, sidekiq, or resque) that you'll put the jobs in. A worker process will process jobs and send them in another process.
Cron and BG jobs go hand in hand
Cron (or a scheduler).
Find all users that have subscribed.
For each user - figure if there is new content to send them
Load up jobs for users that have new content to receive
Background Worker
For each user_subscriber_job - build email content based and user info and subscribed content
Send email out

User stories - Card, conversation and confirmation [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I don't understand a thing about the Card, Conversation, Confirmation formula for user stories.
I don't understand if the conversation and confirmation part must be written down or they remain as a dialogue, in particular the CONVERSATION part.
To be clear: is it right if a write down ALL these things in user stories? (see example below)
Or do I have to write down only the CARD part?
Example:
CARD
As a user of a coffee machine, I want to be able to purchase a beverage.
CONVERSATION
- The user will not be able to purchase a beverage if they do not deposit enough money into the CoffeeMaker
- A user's money will be returned if there is not enough inventory to make the beverage
CONFIRMATION
1 user introduces the amount of money needed to purchase the beverage
2 user selects the beverage
3 user gets the beverage
The 3 C's is a saying used to serve as a reminder on what is important when using User Stories.
A simple card to write down the requirements - as opposed to a heavy weight document.
Having a conversation - collaborating to define the requirements and understand the value.
Confirmation - agreeing on the acceptance criteria, so you know when you are done.
There is another saying which sums up the idea behind User Stories nicely. "The card is a place holder for a conversation". This highlights that the conversation is the important part, not the card artifact. The card can be discarded once the feature has been developed and automation tests written using any suitable acceptable criteria.
The format of a User Story will typically follow:
As a (role) - This can be an end user or a business proxy
I want - A description of what need to be done
So that - the definition of the value
An attempt at your scenario
As a vending machine customer
I want my change returned
So that I do not loose my money
The confirmation part could just be bullet points on the back
Change should be returned if the customer does not put in enough money and then selects a beverage
Or you can use the context specification style, a BDD (Business Driven Development) technique
Given a customer does not put in enough money
When they select a beverage
Then their change should be returned
If you would like to know more I would suggest researching the INVEST principles and reading Mike Cohn's User Stories Applied.
You can do whatever you want ;), from writing down everything to memorizing everything and writing nothing. Personally I write everything down, so the next dev that picks up the story can understand as much as I do and pick up from there.

creating a grails filter to restrict accessing actions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Background:
I'm creating an e-commerce controller that has subscription plans to sign-up for.
Step 1: A user picks a plan.
Step 2: Then enters in their credit card info.
Those actions reside in one controller, and that controller will also have actions such as
edit credit card info
changing their subscription plan
canceling a plan, etc.
Problem Statement:
I want to redirect all of the actions in the controller except picking a plan if the user hasn't picked a plan yet.
Example:
In the UI the user will see links for their billing information and subscription settings, but if they click on those links and they don't have a plan picked yet they get redirected to the action/page to pick a plan.
Question
Is a filter the best place to handle that scenario, and if so how would it be coded?
Is there a better way other than using filters?
What I don't want is to put at the beginning of each action an if statement that checks if the user has a plan, and if they don't redirect them to the pick-a-plan page. Seems like there would be a better way.
I think that in this case a Filter can do the work pretty easilly.
A filter similar to the following one should do the trick:
class MyFilter{
exceptPlan(controller:'myController',action:'pickPlan', invert:true){
before = {
if (!session.plan){
redirect action:'pickPlan'
return false
}
}
}
}

Pass quiz score to Desire2Learn Valence via API

I am trying to integrate an external multimedia application with Valence. The application presents the user with quizzes along the way, with each question mapping to a learning objective. Using the API, how can I send the results of each quiz/objective to D2L so it's part of the overall course grade?
Thanks for your question, it's definitely a good one that I'd love to hear more about!
Right off the top, I'll say that unfortunately the short answer is that Valence currently doesn't support retrieving quiz information, nor accepting question responses to contribute to the user's quiz grade in the grade book, and competency-based evaluation. We recognize this is a big gaping hole in Valence, but the reason why we don't have it yet is due to an assessment tools re-architecture which we're embarking on now, which will put things in place to expose more assessments tools functionality via Valence.
That said, I'd love to capture more details about your use case so that we # D2L can be well-positioned to support it in the future.
Can I assume that you would want to perform the quiz create, update, delete operations, inclusive of learning objective question association, directly in D2L, and not via Valence?
Get Questions: Would you be looking to retrieve all quiz question information, providing a quiz identifier?
Submit Responses, and Trigger Evaluation: Would you be looking to submit all quiz question responses, in order to trigger automatic evaluation, to populate the quiz's score in the grade book, and contribute to competency-based evaluation? Would you ever have a case where a question response was provided which required manual evaluation (such as a short/long answer question type)? If so, how would you like to see that handled?
Many thanks again, I appreciate your time to communicate this request.

Resources