mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-23 04:55:08 +01:00
02194838dd
* HTML e-mails for NotificationMailer (except digest) * Add HTML template for digest * Fix build
39 lines
1.4 KiB
Ruby
39 lines
1.4 KiB
Ruby
# Preview all emails at http://localhost:3000/rails/mailers/notification_mailer
|
|
|
|
class NotificationMailerPreview < ActionMailer::Preview
|
|
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/mention
|
|
def mention
|
|
m = Mention.last
|
|
NotificationMailer.mention(m.account, Notification.find_by(activity: m))
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/follow
|
|
def follow
|
|
f = Follow.last
|
|
NotificationMailer.follow(f.target_account, Notification.find_by(activity: f))
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/follow_request
|
|
def follow_request
|
|
f = Follow.last
|
|
NotificationMailer.follow_request(f.target_account, Notification.find_by(activity: f))
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/favourite
|
|
def favourite
|
|
f = Favourite.last
|
|
NotificationMailer.favourite(f.status.account, Notification.find_by(activity: f))
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/reblog
|
|
def reblog
|
|
r = Status.where.not(reblog_of_id: nil).first
|
|
NotificationMailer.reblog(r.reblog.account, Notification.find_by(activity: r))
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/notification_mailer/digest
|
|
def digest
|
|
NotificationMailer.digest(Account.first, since: 90.days.ago)
|
|
end
|
|
end
|