Sha256: 5644a2c44848f3adcd2b7436732c1cb149a16224f44275accd2d124f7d3a7a82
Contents?: true
Size: 897 Bytes
Versions: 24
Compression:
Stored size: 897 Bytes
Contents
# frozen_string_literal: true class NotificationMailer < ApplicationMailer helper :base layout nil def article(article, user) @user = user @blog = article.blog @article = article build_mail @blog, @user, "New article: #{article.title}" end def comment(comment, user) @user = user @blog = comment.blog @comment = comment build_mail @blog, @user, "New comment on #{comment.article.title}" end def notif_user(user) @user = user # TODO: Make user blog-dependent @blog = Blog.first build_mail @blog, @user, "Welcome to Publify" end private def make_subject(blog, subject) "[#{blog.blog_name}] #{subject}" end def build_mail(blog, user, subject) headers["X-Mailer"] = "Publify #{PublifyCore::VERSION}" mail(from: blog.email_from, to: user.email, subject: make_subject(blog, subject)) end end
Version data entries
24 entries across 24 versions & 2 rubygems