Skip to content

v0.3.0

Compare
Choose a tag to compare
@croaky croaky released this 21 Feb 21:33
11fd257

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.