I hereby claim:
- I am bsmth on github.
- I am bsmth (https://keybase.io/bsmth) on keybase.
- I have a public key ASAP6sCEQqTVAtvKB6NAtD9FKDCFedfI6Cbfub88n7vVsAo
To claim this, I am signing this object:
| import csv | |
| import json | |
| import urllib.parse | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| SENDER = "EMnify Event Notifications <b.smith@emnify.com>" | |
| RECIPIENT = "brian.smith@emnify.com" | |
| AWS_REGION = "eu-west-1" |
| import csv | |
| import json | |
| import urllib.parse | |
| import boto3 | |
| s3 = boto3.client('s3') | |
| sns = boto3.client('sns') | |
| def lambda_handler(event, context): |
| var https = require('https'); | |
| var util = require('util'); | |
| exports.handler = function(event, context) { | |
| console.log(JSON.stringify(event, null, 2)); | |
| console.log('From SNS:', event.Records[0].Sns.Message); | |
| // The webhook defaults can be overridden by these fields: | |
| var postData = { | |
| "channel": "#endpoint-alerts", |
| ''' | |
| Originally found in https://towardsdatascience.com/flattening-json-objects-in-python-f5343c794b10 | |
| edited to shorten key names as far as possible. | |
| ''' | |
| import json | |
| json_example = { | |
| "glossary": { | |
| "title": "example glossary", |
| <!-- | |
| Basic Use: | |
| <h1 >{{event_description}}</h1> | |
| <p>New {{event_description}} detected on the EMnify platform:</p> | |
| <p >To view the status of <strong>{{endpoint_name}}</strong>, visit: | |
| <a href="https://cdn.emnify.net/#/endpoints/{{endpoint_id}}">Endpoints / {{endpoint_id}}</a></p> | |
| --> | |
| <div><style type="text/css"> |
| { | |
| "Template": { | |
| "TemplateName": "NotificationTemplate", | |
| "SubjectPart": "New {{event_description}} Notification", | |
| "HtmlPart": "<div><style type=\"text/css\"><!--.notification body, .notification .x_background_main, .notification p, .notification table, .notification td, .notification div{font-family:'Lato','Helvetica Neue',Helvetica,Arial,sans-serif}.notification img{border:none; max-width:100%}.notification p{padding-bottom:2px}.notification body{background:#fff; font-size:17px; line-height:24px; margin:0; padding:0}.notification table{border-collapse:collapse; width:100%}.notification td{font-size:17px; line-height:24px; vertical-align:top}.notification .x_email_footer td, .notification .x_email_footer p, .notification .x_email_footer span, .notification .x_email_footer a{font-size:15px; text-align:center; color:#434245}.notification .x_email_footer td{padding-top:20px}.notification h1, .notification h2, .notification h3, .notification h4{color:#434245; font-weight:400; line-height:1.4; margin: |
| import csv | |
| import json | |
| import urllib.parse | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| SENDER = "EMnify Event Notifications <b.smith@emnify.com>" | |
| RECIPIENT = "endpoint.is.online@gmail.com" | |
| AWS_REGION = "eu-west-1" |
| { | |
| "Records": [ | |
| { | |
| "EventSource": "aws:sns", | |
| "EventVersion": "1.0", | |
| "EventSubscriptionArn": "arn:aws:sns:eu-west-1:489024636830:email-notifications:91018fd5-5f62-434f-9162-fd4635c5fef4", | |
| "Sns": { | |
| "Type": "Notification", | |
| "MessageId": "8bd15777-93da-5f6e-8577-01335b0028ee", | |
| "TopicArn": "arn:aws:sns:eu-west-1:.....my-email-topic", |
| require 'spec_helper' | |
| describe "Homepage" do | |
| before :each do | |
| visit "/index.html" | |
| end | |
| it "has a title" do | |
| expect(page).to have_css("h1", text: "GitHub Help") |
I hereby claim:
To claim this, I am signing this object: