Blogs

SendGrid Email Notification

By ani posted Sep 24, 2014 02:31 PM

  

SendGrid provides a cloud-based email delivery service that assists businesses with transactional email management such as shipping notifications, friend requests, sign-up confirmations, and email newsletters. This integration with ClearPass Exchange extends that transaction email capability to policy enforcement for your network. For example, you may want to send an email notification that a device attempting to connect to your network has breached your mobile device policy and removed the MDM profile.

AH contributor: cam

Specifications

 

Administration -> External Servers -> Endpoint Context Servers

Select Server Type

Generic HTTP

Server Name

<Your integration name>

Server Base URL

https://sendgrid.com

Username

<Not Applicable>

Password

<Not Applicable> 

Administration -> Dictionaries -> Context Server Actions

Action Tab

Server Type

Generic HTTP

Server Name

<Select your integration name>

Action Name

<Describe the action>

HTTP Method

POST

URL

/api/mail.send.json

Header Tab

Header Name/Header Value

Content-Type=application/x-www-form-urlencoded

Content Tab

Content-Type

PLAIN

Content

to=principal@example.com&toname=School Principal&subject=MDM Profile Removed&html=<p>The following device has attempted to connect to the K12-CLASSROOM WiFi network:</p> <b>Mac Address: </b>%{Connection:Client-Mac-Address}</br><b>Enrolled User: </b>%{Authentication:Full-Username}</br><b>Device Serial: </b>%{Endpoint:Serial Number}</br><b>Mobile: </b>%{Endpoint:Model}</br><b>OS Version: </b>%{Endpoint:OS Version}</br><b>Location: </b>%{Radius:Aruba:Aruba-Location-Id}</br><br>The MDM Profile has been detected as being removed by the user&from=clearpass@example.com&api_user=%{api_user}&api_key=%{api_key}

Attributes Tab

Attribute Name/Attribute Value

api_user=YOUR-SENDGRID-USERNAME
api_key=YOUR-SENDGRID-PASSWORD   
Connection:Client-Mac-Address=unknown
Authentication:Full-Username=unknown
Endpoint:Serial Number=unknown
Endpoint:Model=unknown
Endpoint:OS Version= unknown
Radius:Aruba:Aruba-Location-Id=Classroom

Tips & Tricks

SendGrid offer a free account that allows up to 200 email messages per day. Be sure to update your SendGrid credentials in the Attributes above for api_user and api_key. Also using HTML tags in the API content allows for a cleanly formatted email message.
1 comment
6 views

Comments

Aug 02, 2016 02:42 AM

Hi,

SendGrid has an updated v3 API:

 

Action

Server Type: Generic HTTP

Server Name:api.sendgrid.com

HTTP Method: POST

URL: /v3/mail/send

 

Header

Authorization = Bearer API-Secret-Key

Content-Type = application/json

 

Content

Content-Type: JSON

Content:

{
"personalizations": [
{
"to": [
{
"email": "xxxx@xxxx.com.au"
}
],
"subject": "Test Message"
}
],
"from": {
"email": "xxxx@xxxx.com.au"
},
"content": [
{
"type": "text",
"value": "This is a test message"
}
]
}