Users are either readers or subscribers. When a new article is published, subscribers get a full text e-mail, readers get a teaser text. Assuming scopes in the model for readers/subscribers, is this right or do I need another conditional for each type of user?
if @article.valid?
User.subscribers.each do |user|
ArticleMailer.send_article_full(@article, user).deliver_now
end
User.readers.each do |user|
ArticleMailer.send_article_teaser(@article, user).deliver_now
end
redirect_to :root, notice: "Article sent"
else
render :new, notice: "There was an error"
end