mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-05 07:19:14 +00:00
Once upon a time we needed a helper to set the `from` header of emails. This is now set in the ApplicationMailer and not necessary any more.
18 lines
466 B
Ruby
18 lines
466 B
Ruby
# frozen_string_literal: true
|
|
|
|
module OpenFoodNetwork
|
|
module EmailHelper
|
|
# Ensures the value `perform_deliveries` had is restored. This saves us
|
|
# from messing up with the test suite's global state which is cause of
|
|
# trouble.
|
|
def performing_deliveries
|
|
old_value = ActionMailer::Base.perform_deliveries
|
|
ActionMailer::Base.perform_deliveries = true
|
|
|
|
yield
|
|
|
|
ActionMailer::Base.perform_deliveries = old_value
|
|
end
|
|
end
|
|
end
|