Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1614698
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
Sat, Mar 21, 2:44 AM
Size
1 KB
Mime Type
text/x-ruby
Expires
Mon, Mar 23, 2:44 AM (2 h, 6 m)
Engine
blob
Format
Raw Data
Handle
354155
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