mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-12 23:27:48 +00:00
21 lines
600 B
Ruby
21 lines
600 B
Ruby
require 'devise/mailers/helpers'
|
|
class EnterpriseMailer < Spree::BaseMailer
|
|
include Devise::Mailers::Helpers
|
|
|
|
def confirmation_instructions(record, token, opts={})
|
|
@token = token
|
|
find_enterprise(record)
|
|
opts = {
|
|
subject: "Please confirm your email for #{@enterprise.name}",
|
|
to: [ @enterprise.owner.email, @enterprise.email ].uniq,
|
|
from: from_address,
|
|
}
|
|
devise_mail(record, :confirmation_instructions, opts)
|
|
end
|
|
|
|
private
|
|
def find_enterprise(enterprise)
|
|
@enterprise = enterprise.is_a?(Enterprise) ? enterprise : Enterprise.find(enterprise)
|
|
end
|
|
end
|