Add admin mailers and tests to white_ips

This commit is contained in:
Sergei Tsoganov 2023-07-10 09:51:56 +03:00
parent 149cbb6138
commit f68d8e91c2
8 changed files with 45 additions and 6 deletions

View file

@ -58,7 +58,7 @@ module Repp
return
end
uncommit_and_notify_admins(ip: ip, action: 'deleted') if ip.interfaces.include?(WhiteIp::API)
uncommit_and_notify_admins(ip: ip, action: 'deleted') if api_interface?(ip)
render_success
end

View file

@ -1,6 +1,7 @@
<p>This email is to inform you that an API Whitelisted IP address was deleted by Registrar Portal API user. Please review the details below:</p>
<ul>
<li>Registrar: <%= @api_user.registrar.name %></li>
<li>API User: <%= @api_user.username %></li>
<li>IP Address: <%= @white_ip.ipv4.presence || @white_ip.ipv6 %></li>
<li>Interface: <%= @white_ip.interfaces.join(', ') %></li>

View file

@ -1,5 +1,6 @@
This email is to inform you about an API Whitelisted IP address change by Registrar Portal API user. Please review the details below:
Registrar: <%= @api_user.registrar.name %>
API User: <%= @api_user.username %>
IP Address: <%= @white_ip.ipv4.presence || @white_ip.ipv6 %>
Interface: <%= @white_ip.interfaces.join(', ') %>

View file

@ -1,6 +1,7 @@
<p>This email is to inform you about an API Whitelisted IP address change by Registrar Portal API user. Please review the details below:</p>
<ul>
<li>Registrar: <%= @api_user.registrar.name %></li>
<li>API User: <%= @api_user.username %></li>
<li>IP Address: <%= @white_ip.ipv4.presence || @white_ip.ipv6 %></li>
<li>Interface: <%= @white_ip.interfaces.join(', ') %></li>

View file

@ -1,5 +1,6 @@
This email is to inform you about an API Whitelisted IP address change by Registrar Portal API user. Please review the details below:
Registrar: <%= @api_user.registrar.name %>
API User: <%= @api_user.username %>
IP Address: <%= @white_ip.ipv4.presence || @white_ip.ipv6 %>
Interface: <%= @white_ip.interfaces.join(', ') %>