Added postmaster@ and abuse@ to virtuals when you create a domain. Hard coded at the moment.
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
class Domain < ApplicationRecord
|
||||
after_create :create_abuse_postmaster
|
||||
|
||||
has_many :credentials, dependent: :destroy
|
||||
has_many :virtuals, dependent: :destroy
|
||||
validates :domain, presence: true
|
||||
validates :domain, uniqueness: true
|
||||
|
||||
private
|
||||
def create_abuse_postmaster
|
||||
Virtual.create(email: "abuse@#{self.domain}", destination: "jez@warwickhunt.com", domain_id: self.id)
|
||||
Virtual.create(email: "postmaster@#{self.domain}", destination: "jez@warwickhunt.com", domain_id: self.id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user