Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1966968
notification_mailer.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 17, 2:46 AM
Size
1 KB
Mime Type
text/x-ruby
Expires
Tue, May 19, 2:46 AM (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
376537
Attached To
rWEBDNS WebDNS (edet4)
notification_mailer.rb
View Options
class
NotificationMailer
<
ActionMailer
::
Base
default
from
:
WebDNS
.
settings
[
:mail_from
]
ENVIRON_PREFIX
=
WebDNS
.
settings
[
:notifications_prefix
]
||
'webdns'
PREFIXES
=
{
create
:
'Created'
,
update
:
'Modified'
,
destroy
:
'Deleted'
,
}
def
notify_record
(
record
:,
context
:,
user
:,
admin
:,
others
:,
changes
:)
@record
=
record
@context
=
context
@user
=
user
@admin
=
admin
@changes
=
changes
mail
(
to
:
others
,
subject
:
"[
#{
ENVIRON_PREFIX
}
] [record]
#{
PREFIXES
[
context
.
to_sym
]
}
#{
record
.
to_short_dns
}
"
)
end
def
notify_record_bulk
(
domain
:,
user
:,
admin
:,
others
:,
operations
:)
@domain
=
domain
@user
=
user
@admin
=
admin
@operations
=
operations
mail
(
to
:
others
,
subject
:
"[
#{
ENVIRON_PREFIX
}
] [record] Bulk operations for '
#{
domain
.
name
}
'"
)
end
def
notify_domain
(
domain
:,
context
:,
user
:,
admin
:,
others
:,
changes
:)
@domain
=
domain
@context
=
context
@user
=
user
@admin
=
admin
@changes
=
changes
mail
(
to
:
others
,
subject
:
"[
#{
ENVIRON_PREFIX
}
] [domain]
#{
PREFIXES
[
context
.
to_sym
]
}
#{
domain
.
name
}
"
)
end
end
Event Timeline
Log In to Comment