Skip to content

Commit 50f15b5

Browse files
committed
Tidy email actions article
1 parent ffa86cf commit 50f15b5

File tree

2 files changed

+126
-80
lines changed

2 files changed

+126
-80
lines changed

articles/iot-accelerators/iot-accelerators-remote-monitoring-email-actions.md

Lines changed: 121 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -12,121 +12,167 @@ ms.topic: conceptual
1212
# As a developer, I want to add email as an action to a new or existing rule within my Remote Monitoring solution.
1313
---
1414

15-
1615
# Add an email action
17-
Adding an email action to a rule helps make sure that you will never miss an alert. You can either add an email action to an existing rule that you have defined earlier, or while creating a new rule.
16+
17+
Email actions help make sure you never miss alerts. You can add an email action to an existing rule, or when you create a new rule.
1818

1919
[!INCLUDE [iot-accelerators-tutorial-prereqs](../../includes/iot-accelerators-tutorial-prereqs.md)]
2020

21-
To create or modify a rule, you must be an Admin for your solution accelerator, or have the correct permissions. [Learn how to configure role-based access controls](iot-accelerators-remote-monitoring-rbac.md).
21+
To create or modify a rule, you must be an [**Administrator**, or have the correct permissions](iot-accelerators-remote-monitoring-rbac.md).
22+
23+
## Edit an existing rule
24+
25+
Follow these steps to add an email action to an existing rule:
26+
27+
1. Navigate to your Remote Monitoring solution.
28+
29+
1. From the **Dashboard**, navigate to the **Rules** page:
30+
31+
![Rules page](./media/iot-accelerators-remote-monitoring-email-actions/rules.png)
2232

23-
## Edit Existing rule
33+
1. Click the checkbox next to the existing rule to modify, and then click **Edit** at the top. An editable **Rule** panel appears.
2434

25-
Follow these steps to add an email action:
26-
1. Navigate to your Remote Monitoring solution.
27-
2. From your dashboard, navigate to the **Rules** page.
35+
1. In the **Action** section, toggle **Email enabled** to **On**.
2836

29-
![rules](./media/iot-accelerators-remote-monitoring-email-actions/rules.png)
37+
1. The first time you enable an email action in the solution accelerator, you must [sign in to Outlook](#outlook).
3038

31-
3. Click the checkbox next to the [existing rule](iot-accelerators-remote-monitoring-automate#edit-an-existing-rule) that you would like to modify, and then click **Edit** at the top. An editable flyout will appear.
32-
4. In the Action section, toggle **Email enabled** to on.
33-
5. If it is the first-time email actions have been enabled within the solution accelerator, you will need to [sign in to outlook](#outlook).
34-
6. Enter an email address into the recipient box and hit enter for each email address added.
35-
![address](./media/iot-accelerators-remote-monitoring-email-actions/address.png)
36-
7. Enter a subject for the email.
37-
8. Enter any additional notes for the email recipients in **text format**. *HTML* formatting is supported by editing the email template. [Directions for editing the HTML format](#htmledit)
38-
9. Make sure that **Rule Status** is enabled
39-
10. Click **Apply**
39+
1. Enter an email address into the recipient box and press the **Enter** key for each email address to add:
40+
41+
![Address entry](./media/iot-accelerators-remote-monitoring-email-actions/address.png)
42+
43+
1. Enter a subject for the email.
44+
45+
1. Enter any additional notes for the email recipients as plain text. You can use HTML formatting if you [edit the email template](#htmledit).
46+
47+
1. Make sure that the **Rule Status** is set to **Enabled**.
48+
49+
1. Click **Apply**.
4050

4151
## Create a new rule
4252

43-
Follow these steps to add an email action:
44-
1. Navigate to your Remote Monitoring solution.
45-
2. From your dashboard, navigate to the **Rules** page.
53+
Follow these steps to add an email action when you create a new rule:
4654

47-
![rules](./media/iot-accelerators-remote-monitoring-email-actions/rules.png)
55+
1. Navigate to your Remote Monitoring solution.
4856

49-
3. Follow the [create a rule](iot-accelerators-remote-monitoring-automate#create-a-rule) and [create an advanced rule](iot-accelerators-remote-monitoring-automate#create-an-advanced-rule) up to the **Severity level** only. Do *not* click apply yet.
50-
4. In the Action section, toggle **Email enabled** to on.
51-
5. If it is the first-time email actions have been enabled within the solution accelerator, you will need to [sign in to outlook](#outlook).
52-
6. Enter an email address into the recipient box and hit enter for each email address added.
53-
![address](./media/iot-accelerators-remote-monitoring-email-actions/address.png)
54-
7. Enter a subject for the email.
55-
8. Enter any additional notes for the email recipients in **text format**. *HTML* formatting is supported by editing the email template. [Directions for editing the HTML format](#htmledit)
56-
9. Make sure that **Rule Status** is enabled
57-
10. Click **Apply**
57+
1. From the **Dashboard**, navigate to the **Rules** page:
5858

59-
Your rule with *Email Action* has now been enabled. Each time the action is triggered, a new email will be sent out.
59+
![Rules page](./media/iot-accelerators-remote-monitoring-email-actions/rules.png)
6060

61-
## Sign in to Outlook <a name="outlook"></a>
61+
1. Follow the steps in the [create a rule section](iot-accelerators-remote-monitoring-automate#create-a-rule). The follow the steps in the [create an advanced rule](iot-accelerators-remote-monitoring-automate#create-an-advanced-rule) section up to the point where you set a **Severity level**. Don't click **Apply** yet.
6262

63-
If it is your first-time enabling email actions within your solution accelerator, you need to sign into Outlook. This is to set up an email account, which will be responsible for sending out the email notification.
63+
1. In the **Action** section, toggle **Email enabled** to **On**.
6464

65-
> [!NOTE]
66-
> It is recommended that you create a specific Outlook account just for solution accelerator notifications and use that to sign in with. You will continue to see this warning note until you have signed in with an Outlook account. Once you have signed in, you will see a successful message below the email actions toggle.
65+
1. The first time you enable an email action in the solution accelerator, you must [sign in to Outlook](#outlook).
6766

68-
If your application was deployed by someone with a **contributor** role on the subscription, you will see the following screenshot. Follow the instructions below to set up Outlook for your application.
67+
1. Enter an email address into the recipient box and press the **Enter** key for each email address to add:
68+
69+
![Address entry](./media/iot-accelerators-remote-monitoring-email-actions/address.png)
70+
71+
1. Enter a subject for the email.
72+
73+
1. Enter any additional notes for the email recipients as plain text. You can use HTML formatting if you [edit the email template](#htmledit).
74+
75+
1. Make sure that the **Rule Status** is set to **Enabled**.
76+
77+
1. Click **Apply**.
78+
79+
Your rule with an email action is now enabled. Each time the action is triggered, a new email is sent to the recipients.
80+
81+
## Sign in to Outlook <a name="outlook"></a>
82+
83+
The first time you enable an email action in your solution accelerator, you must sign into Outlook. This action sets up the email account that sends out the email notifications.
84+
85+
> [!NOTE]
86+
> You should create a specific Outlook account just for solution accelerator notifications and use that account when you enable your first email action. The warning message continues to display until you sign in with an Outlook account. When you've signed in, you see the following success message:
6987
7088
![learn more](./media/iot-accelerators-remote-monitoring-email-actions/learnmore.png)
7189

72-
### Contributor role Outlook set up
73-
Since the application was deployed by someone with the **contributor** role in the subscription, the application does
74-
not have sufficient permissions to set up and verify email actions through the WebUI. However, the following steps will allow you to manually set up and verify the email actions.
90+
### Contributor role Outlook setup
91+
92+
If someone in the **contributor** role in the subscription deployed the solution accelerator, the application doesn't have sufficient permissions to set up and verify email actions through the Web UI.
93+
94+
Before you start, create an Outlook account to use to send email notifications from your solution accelerator.
95+
96+
The following steps show you how to set up and verify the email actions manually:
97+
98+
1. Navigate to the [Azure portal](https://portal.azure.com).
99+
100+
1. Navigate to the Resource Group for your solution accelerator.
101+
102+
1. Click the **office365-connector**:
75103

76-
1. Go to the [Azure portal](https://portal.azure.com)
77-
2. Navigate to the Resource Group for your solution accelerator
78-
3. Click on the office 365 connector (API Connection)
79104
![API Connection](./media/iot-accelerators-remote-monitoring-email-actions/apiconnector.png)
80-
4. Click on the banner to begin the authorization process
105+
106+
1. Click the banner to begin the authorization process:
107+
81108
![authorize](./media/iot-accelerators-remote-monitoring-email-actions/connector.png)
82-
5. Click the **authorize** button in which it will ask you to sign in. This account you sign in with will be the email address the application uses to send email from. We advise that you create an outlook account ahead of time to send email notifications for your solution accelerator from.
83-
![authorize button](./media/iot-accelerators-remote-monitoring-email-actions/authorize.png)
84-
![sign in](./media/iot-accelerators-remote-monitoring-email-actions/signin.png)
85-
7. Click **Save** at the bottom. Your authorization will be successful if the banner is gone.
86-
9. To change the email address from which the notifications are sent from, click **Edit API connection**.
109+
110+
1. Click **Authorize**. You're prompted to sign in. The account you use to sign in should be the email address the application uses to send email notifications:
111+
112+
![Authorize button](./media/iot-accelerators-remote-monitoring-email-actions/authorize.png)
113+
114+
1. Click **Save** at the bottom. Your authorization will be successful if the banner is gone.
115+
116+
1. To change the email address from which the notifications are sent from, click **Edit API connection**.
117+
87118
![change email](./media/iot-accelerators-remote-monitoring-email-actions/editemail.png)
88119

89-
### Owner role Outlook set up
90-
Since the application was deployed by someone with the **owner** role in the subscription, the application is able to verify email actions have been correctly set up through the WebUI. The following steps will help you sign in and set up email actions.
120+
### Owner role Outlook setup
121+
122+
If someone in the **owner** role in the subscription deployed the solution accelerator, the application can verify email actions have been correctly set up through the Web UI.
91123

92-
1. Click to sign in to Outlook. You will be taken to the Azure portal.
93-
![sign in](./media/iot-accelerators-remote-monitoring-email-actions/owneroutlook.png)
94-
2. Click the **authorize** button in which it will ask you to sign in. This account you sign in with will be the email address the application uses to send email from. We advise that you create an outlook account ahead of time to send email notifications for your solution accelerator from.
95-
3. Click **Save** at the bottom. Return back to your application and refresh the page.
96-
4. You will see a banner if you have successfully configured the email notification.
97-
![successful lo in](./media/iot-accelerators-remote-monitoring-email-actions/success.png)
124+
Before you start, create an Outlook account to use to send email notifications from your solution accelerator.
98125

99-
## Customizing the email HTML <a name="htmledit"></a>
126+
The following steps help you to sign in and set up email actions:
100127

101-
Out of the box, the Remote Monitoring solution accelerator provides a basic HTML template for emails sent when alerts are triggered. The email constructed is based off of the variables filled out when setting up email action. Here's an example of email sent when an alert is triggered and email actions are enabled:
128+
1. Click to sign in to Outlook. You're taken to the Azure portal:
129+
130+
![Sign in to Outlook](./media/iot-accelerators-remote-monitoring-email-actions/owneroutlook.png)
131+
132+
1. Click **Authorize**. You're prompted to sign in. The account you use to sign in should be the email address the application uses to send email notifications:
133+
134+
1. Click **Save**. Return to your solution accelerator and refresh the page.
135+
136+
1. If you've successfully configured the email notification, you see this message:
137+
138+
![Successful Outlook sign in](./media/iot-accelerators-remote-monitoring-email-actions/success.png)
139+
140+
## Customize the email HTML <a name="htmledit"></a>
141+
142+
Out-of-the-box, the Remote Monitoring solution accelerator provides a basic HTML template for action emails. The email template uses values from the email action settings. Here's an example email:
102143

103144
![email example](./media/iot-accelerators-remote-monitoring-email-actions/emailtemplate.png)
104145

105-
However, if you would like to edit the HTML to include more information, custom images, etc. follow these steps:
106-
1. Make sure that you have cloned the Github repository for Remote Monitoring in either .NET or Java.
107-
2. Navigate to the email template location.
108-
109-
`Dotnet: device-telemetry\ActionsAgent\data\EmailTemplate.html`
110-
111-
`Java device-telemetry/app/resources/data/EmailTemplate.html`
112-
3. This template is where you can add or remove any parameters. Make sure to also add or remove, or replace calls as needed.
146+
The following steps show you how to edit the HTML email template. For example, you can include more information or add custom images:
147+
148+
1. Clone either the Java or .NET Remote Monitoring GitHub repository:
149+
150+
1. Navigate to the email template location:
151+
152+
`Dotnet: device-telemetry\ActionsAgent\data\EmailTemplate.html`
153+
154+
`Java device-telemetry/app/resources/data/EmailTemplate.html`
155+
156+
1. You can add or remove any parameters in this template to customize the message. You can also add, remove, or replace calls as needed:
157+
158+
For example, in the .NET code:
159+
`emailTemplate = emailTemplate.Replace("${subject}", emailAction.GetSubject());`
160+
161+
For example, in the Java code:
162+
`this.emailTemplate.replace("${subject}", emailAction.GetSubject());`
113163

114-
For example, in the .NET code:
115-
`emailTemplate = emailTemplate.Replace("${subject}", emailAction.GetSubject());`
164+
1. Parameters in the template take the form of `${...}`. To delete a parameter, delete the required line. To add a parameter, add a line with the value to insert.
116165

117-
For example, in the Java code:
118-
`this.emailTemplate.replace("${subject}", emailAction.GetSubject());`
119-
4. Parameters in the template are in the form of `${...}`. If you want to delete a parameter, just delete the required line. If you want to add a parameter, add a line with the value you want inserted into the template in the format above.
120-
5. If you would like to add images or any other custom text, updates can be directly in the `EmailTemplate.HTML`
166+
1. To add images or custom text, update the EmailTemplate.HTML file directly.
121167

122168
## Throttling
123169

124-
The Remote Monitoring solution accelerator out of the box uses Outlook to send out the email notifications. Outlook limits the number of emails sent to [30 emails per 1 minute](https://docs.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#receiving-and-sending-limits). Email clients receiving the emails may also throttle the number of emails received per minute. Check with your specific email client on limitations. It is recommended that when you set up email notification for a rule, that you have the rule calculate over an average of 1 minute or more, and not instant, as shown below.
170+
The Remote Monitoring solution accelerator uses Outlook to send email notifications. Outlook limits the number of emails sent to [30 emails per 1 minute](https://docs.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#receiving-and-sending-limits). Email clients receiving the emails may also throttle the number of emails received per minute. Check with your specific email client on limitations. When you set up email notification for a rule, the rule should calculate average values over a period of at least one minute, and not use instant values:
125171

126-
![calculation](./media/iot-accelerators-remote-monitoring-email-actions/calculation.png)
172+
![Average calculation](./media/iot-accelerators-remote-monitoring-email-actions/calculation.png)
127173

128174
## Next steps
129175

130-
This guide showed you how to add an email action to a new or existing rule within a Remote Monitoring solution and how to edit the HTML.
176+
This guide showed you how to add an email action to a new or existing rule within a Remote Monitoring solution. The guide also showed you and how to edit the HTML that defines the message format.
131177

132178
The suggested next step is to learn [how to use alerts and fix device issues](iot-accelerators-remote-monitoring-maintain.md).

articles/iot-accelerators/iot-accelerators-remote-monitoring-rbac.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ This article provides information about how to configure role-based access contr
1818

1919
## Default settings
2020

21-
When you first deploy the Remote Monitoring solution, there are two roles: **Admin** and **Read Only**.
21+
When you first deploy the Remote Monitoring solution, there are two roles: **Admin** and **Read Only**.
2222

23-
Any user in the **Admin** role has full access to the solution, including the following permissions below. A user in the **Read Only** role will only have access to view the solution.
23+
Any user in the **Admin** role has full access to the solution, including the following permissions below. A user in the **Read Only** role will only have access to view the solution.
2424

2525
| Permission | Admin | Read Only |
2626
|---------------- |-------|-----------|
@@ -41,12 +41,12 @@ Any user in the **Admin** role has full access to the solution, including the fo
4141

4242
By default, the user who deployed the solution is automatically assigned the **Admin** role and is an Azure Active Directory application owner. As an application owner, you can assign roles to other users through the Azure portal. If you want another user to assign roles in the solution, they must also be set as an application owner in the Azure portal.
4343

44-
> [!NOTE]
45-
> The user who deployed the solution is the **only person** who can view it immediately after its been created. To grant others access to view the application as either a Read Only, Admin, or a Custom role, see the following directions below on add or remove users.
44+
> [!NOTE]
45+
> The user who deployed the solution is the **only person** who can view it immediately after its been created. To grant others access to view the application as either a Read Only, Admin, or a Custom role, see the following directions below on add or remove users.
4646
4747
## Add or remove users
4848

49-
As an Azure Active Directory application owner, you can use the Azure portal to add or remove a user to a role from the Remote Monitoring solution. The following steps use the [Azure Active Directory enterprise application](../active-directory/manage-apps/add-application-portal.md#find-your-azure-ad-tenant-application) that was created for you when you deployed the Remote Monitoring solution.
49+
As an Azure Active Directory application owner, you can use the Azure portal to add or remove a user to a role from the Remote Monitoring solution. The following steps use the [Azure Active Directory enterprise application](../active-directory/manage-apps/add-application-portal.md#find-your-azure-ad-tenant-application) that was created when you deployed the Remote Monitoring solution.
5050

5151
1. Sign in to the [Azure portal](https://portal.azure.com).
5252

0 commit comments

Comments
 (0)