docbrown/app/mailers/application_mailer.rb
rhymes 1b60ee5009 Use timezone aware methods (#893)
* Use timezone aware datetime methods

* Use timezone aware date parse for GitHub issue tag

* Introduce a bit of chaos programming using Zonebie

Zonebie uses a random timezone to run tests, it's a really good way to see if the code is timezone dependent or not.

* Convert GitHub issue date as UTC
2018-10-18 16:26:29 -04:00

13 lines
410 B
Ruby

class ApplicationMailer < ActionMailer::Base
default from: "DEV Community <yo@dev.to>"
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