Skip to content

Commit

Permalink
fix: notification flags (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbystedt authored Oct 25, 2024
1 parent bd73eff commit b7d342a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions src/commands/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ export default class Monitor extends Command {
bindBroker(flags['broker-api-url'], flags['broker-token']);
bindNotification(
{
host: notificationSmtpHost,
port: notificationSmtpPort,
secure: notificationSmtpSecure,
host: flags['notification-smtp-host'],
port: flags['notification-smtp-port'],
secure: flags['notification-smtp-secure'],
},
{
from: notificationOptionFrom,
subject: notificationOptionSubject,
text: notificationOptionTemplateText,
html: notificationOptionTemplateHtml,
from: flags['notification-option-from'],
subject: flags['notification-option-subject'],
text: flags['notification-option-template-text'],
html: flags['notification-option-template-html'],
},
);
await bindTarget(
Expand Down
12 changes: 7 additions & 5 deletions src/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,22 @@ This service uses your connections in Broker's graph to enable (and disable) acc

export const notificationOptionTemplateHtml = {
'notification-option-template-html': Flags.string({
default: `Hi <%= summary.user.name %>,
default: `<html><body><p>Hi <%= summary.user.name %>,</p>
This report shows changes to your account access to <%= config.name %>. The following account changes have occurred.
<p>This report shows changes to your account access to <%= config.name %>. The following account changes have occurred.</p>
<% summary.addRoles.forEach(function(role) { %>
Add: <%= role %><% if (addRoleMap[role]) { %>
<p>Add: <%= role %></p><% if (addRoleMap[role]) { %>
<%= addRoleMap[role] %>
<% }}); %>
<% summary.delRoles.forEach(function(role) { %>
Remove: <%= role %>
<p>Remove: <%= role %></p>
<% }); %>
This service uses your connections in Broker's graph to enable (and disable) access by altering your roles in Common Hosted Single Sign-On (CSS).`,
<p>This service uses your connections in Broker's graph to enable (and disable) access by altering your roles in Common Hosted Single Sign-On (CSS).</p>
</body>
</html>`,
description: 'The notification template in html',
env: 'NOTIFICATION_OPTION_TEMPLATE_HTML',
}),
Expand Down

0 comments on commit b7d342a

Please sign in to comment.