docbrown/app/mailers/application_mailer.rb
Mohab Abd El-Dayem 2c80e9da42 Make The Default Email An Enviroment Variable. (#4677)
* Make the default email an enviroment variable

* Added spaces in Envfile for readability
2019-11-01 09:03:06 -04:00

13 lines
443 B
Ruby

class ApplicationMailer < ActionMailer::Base
default from: "DEV Community <#{ApplicationConfig['DEFAULT_SITE_EMAIL']}>"
layout "mailer"
default template_path: ->(mailer) { "mailers/#{mailer.class.name.underscore}" }
def generate_unsubscribe_token(id, email_type)
Rails.application.message_verifier(:unsubscribe).generate(
user_id: id,
email_type: email_type.to_sym,
expires_at: 31.days.from_now,
)
end
end