2017-07-23 11:17:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2010-07-23 08:42:21 -04:00
|
|
|
class ProcMailer < ActionMailer::Base
|
2016-08-06 13:03:39 -04:00
|
|
|
default to: "system@test.lindsaar.net",
|
|
|
|
"X-Proc-Method" => Proc.new { Time.now.to_i.to_s },
|
2013-07-22 14:23:53 -04:00
|
|
|
subject: Proc.new { give_a_greeting },
|
2017-08-24 01:13:54 -04:00
|
|
|
"x-has-to-proc" => :symbol,
|
|
|
|
"X-Lambda-Arity-0" => ->() { "0" },
|
|
|
|
"X-Lambda-Arity-1-arg" => ->(arg) { arg.computed_value },
|
|
|
|
"X-Lambda-Arity-1-self" => ->(_) { self.computed_value }
|
2010-07-23 08:42:21 -04:00
|
|
|
|
|
|
|
def welcome
|
|
|
|
mail
|
|
|
|
end
|
2010-08-14 01:13:00 -04:00
|
|
|
|
2017-08-24 01:13:54 -04:00
|
|
|
def computed_value
|
|
|
|
"complex_value"
|
|
|
|
end
|
|
|
|
|
2010-07-23 08:42:21 -04:00
|
|
|
private
|
2016-08-06 13:55:02 -04:00
|
|
|
def give_a_greeting
|
|
|
|
"Thanks for signing up this afternoon"
|
|
|
|
end
|
2010-07-23 08:42:21 -04:00
|
|
|
end
|