bl0b
bl0b

Reputation: 936

app wise after_action in mailer

So, I'm keeping track of every email I send to my user.

I can add after_action :add_email_sent to every mailer file but it's not very DRY.

I'm more looking for a way to have an app wise after_action callback that will be triggered whenever an email is sent.

Upvotes: 0

Views: 198

Answers (1)

dostu
dostu

Reputation: 1518

Create an ApplicationMailer class which inherits from ActionMailer::Base and add after_action to it. Then inherit all mailers from ApplicationMailer.

Upvotes: 1

Related Questions