v0.3.0
Previously, you could prefix the subject line with static text:
Mail.register_interceptor(
RecipientInterceptor.new(
ENV["EMAIL_RECIPIENTS"],
subject_prefix: "[staging]",
),
)
Now, you still prefix with static text.
Or, you can use a proc to prefix the subject line
with contents from the original message:
Mail.register_interceptor(
RecipientInterceptor.new(
ENV["EMAIL_RECIPIENTS"],
subject_prefix: proc { |msg| "[staging] [#{(msg.to + msg.cc + msg.bcc).sort.join(",")}]" }
),
)
The object passed to the proc is an instance of
Mail::Message
.