Well, it’s more than a boat is a cruise ship, the Norweigan Cruise LinesEscape. We will be departing from Miami with port stops in Falmouth (Jamaica); George Town (Grand Cayman); Great Stirrup Cay (Bahamas); Nassau (Bahamas); and come back to Miami.
Chris Woodruff and I will be providing 2 and half days of instruction on .NET Core at TechOutbound. It’ll be a combination of instruction and hands on workshops. Here’s the topics we will be covering.
Entity Framework Core 2.0
ASP.NET Core MVC
ASP.NET Core Web API
Client-side Development with ASP.NET Core
Security and Identity
Debugging and Performance
Hosting and Deployment
Migrating from.NET Framework
Docker and Containers
ASP.NET Core and the Cloud
Register now by following the instructions and use code BFFJG when you do for an additional $100 off your registration
Me too, or at least I was… While the problem I was having might not be related to SendGrid exclusively, I am going to talk about the solution.
Before I go into the solution, let’s talk about the problem first. Many of you know that I run Desert Code Camp in Chandler, AZ. Originally, the site ran on the Microsoft stack, it used ASP.NET (Web Forms) and SQL Server. There is an API for mobile apps and future development but that’s another story. The site has 12,000 registered users. A few thousand are SPAM/Bots, a few thousand are “inactive” accounts (opted out or moved), and the other 6000 or so are active users that have an interest in Desert Code Camp or have attended at least one.
And here lies the first problem.
When an announcement email goes out to our attendees or users of the site, we need to send out about 6000 emails. I used to do this by sending the email from a web page through code using System.Net.SMTP via localhost. At first, it wasn’t an issue. After a while, as Desert Code Camp grew, this became more and more of a problem. Typically the page would time out or IIS would die or something. So I needed to find a solution. Sometime last year, probably around this time, I offloaded the processing of emails to Azure Queue Storage and used Azure WebJobs to handle the “logic”. But wait, Azure does not support sending stuff via localhost. And that is true! This is where SendGrid comes into play. Azure provides, as of the creation of this post, a free 25,000 email per month subscription to SendGrid. For more on that, check out this post.
Now that I implemented the new Azure/SendGrid combination everything was great.
Fast forward a year, to this past weekend, I announced that the next Desert Code Camp was happening on Twitter and some people started submitting sessions. This is great! But I noticed that I was wasn’t getting my emails about the submissions. At first, I thought, “Oh Joe, you forgot something when you ‘created’ the new event”. It happens every time :). However, this was not the case this time. Microsoft decided to embrace something called DMARC, Domain-based Message Authentication, Reporting & Conformance. In a nutshell, it checks to see if you are sending emails from the domain you claim you are sending them from, which for me was bad. Not because I was trying to be deceitful, but because I was sending emails saying they were from ‘@hotmail.com‘ and sending them via ‘SendGrid‘ because I wanted people to reply to my Hotmail address. Well, when Microsoft implemented the DMARC…
What this means: As of June 2016, you can no longer send with the From address being anything from a Microsoft address when sending to a domain that checks DMARC before accepting mail.
… it saw my email as not being ‘legitimate‘ and did not deliver it to my inbox and probably others.
The answer is ‘Whitelist‘ your domains while using SendGrid. There are more detailed instructions on how to whitelist a domain using SendGrid here.
What is Whitelabeling?
Whitelabeling allows you to send through your own custom domain instead of SendGrid’s default settings. This will mask the header information of your emails with your data–not theirs–and will improve your email deliverability.
Luckily, SendGrid makes it easy to whitelist your domain(s). Here is how you do it. Please note:You will need access to your domain records, you will be making changes to your TXT or CNAME entries to prove you have rights to the domain.
SendGrid will walk you though everything else you need.
But what about the replies to @Hotmail.com
I’m glad you are still with me :). This part is the easy part. Essentially, I added ‘email@example.com‘ as the ToAddress and added ‘firstname.lastname@example.org‘ as the ReplyTo. As shown in this gist.
I hope this saves you some time to troubleshoot mail delivery to @hotmail.com, @outlook.com, @live.com, @msn.com, @yahoo.com, and @gmail.com.
A few months ago I built a jQuery plugin that uses the Twitter BootstrapCarousel to cycle through images on Flickr. In order to use this plugin you need to get an Api Key from Flickr and have the following software:
For the past 5+ years I’ve had a few different sites hosted at Discount ASP.NET, this site being one of them. Recently, Discount ASP.NET released a new product in the web hosting arena, Everleap. Everleap is a new cloud based hosting solution. I know, the word “cloud” is massively overused nowadays. Everleap differs from other solutions as it uses the Windows Azure Pack for it’s services. The Windows Azure Pack is the same technology that Microsoft uses to run their own Windows Azure hosting platform. Microsoft has made Azure technologies available to their partners so they can build public and private cloud offerings that run in the their own data centers. For more on the Windows Azure Pack check out http://www.everleap.com/cloud-hosting/features/azure-pack-hosting/
The move to Everleap
The move to Everleap was easy considering I already had my site on Discount ASP.NET
This post will go over implementing the foursquare Autocomplete jQuery plugin. In the upcoming days (weeks) I will have a few blog posts on using the foursquare API with C#.
A few months ago I was making updates for the MVP Summit Events site, one of the features I wanted to add was foursquare integration to the site. I was thinking that it would be cool for each of the parties listed on the site, to show how many people have checked in to that event (venue) on foursquare. This way you could see what parties to attend and which ones to avoid :).
In order to determine who was checked in at one of the events, I needed to add the foursquare venue id to all of my venues. For the existing venues, I manually added the foursquare venue id but for new venues I was thinking of making the user experience as easy as possible, a user should enter a few characters and get venues in the area with those characters. The first thing that popped into my head was to use an auto complete control and use foursquare as the data source. So after “Googling it with Bing” I found that there was one control that did this but no longer worked. So what does every good developer do, re-invent the wheel :).
Getting Started with the foursquare API
Just like most social media sites now, foursquare has a REST based API. Foursquare provides a quick start guide to get you started using their API. In order to get started with the foursquare API you will need the following:
A foursquare account (The site does recommend you create a separate foursquare account for your applications.)
foursquare does have many API end points for accessing their data. After checking out several of them I decided to go with the Suggest Completion Venues end point even though (at the time of this writing it was an experimental feature).
Suggest Completion End Point
According to the API end point documentation for the Suggest Completion end point, the end point provides a list of mini-venues partially matching the search term, near the location.
The method uses the HTTP GET verb and has two required parameters; ll and query. The ll parameter which is the latitude and longitude of the users location (or search area) . And the query parameter is the string you want to search for. The results that get returned is an array of mini venues (essentially an arrays without a lot of extra properties, just the minimum set required for suggestion.
Once you have the required files referenced on your page, you can “foursquare auto complete” a textbox by calling the foursquareAutocomplete method as shown here:
Properties and Events
The latitude where you want to look for the venue.
The longitude where you want to look for the venue.
Your foursquare oauth token.
The minimum length the text should be before you kick off the search.
This event is fired once the user selects a venue from the list.
This event is fired if there is an error returned from the foursquare REST API.
This event is fired if there is an error making the call to the foursquare REST API.
Handling the results
Once a user selects the venue from the list, the search event is raised. The search event has two parameters:
Event: The event
Item: the foursquare venue that was returned.
The item that is returned is a custom object that provides the basic address properties for the venue. The properties combined, will look like a US formatted address and will take into account fields that are not populated in foursquare.
The name of the venue
The foursquare venue id
The address line (formatted like a US address) address1, address2
The city line (formatted like a US address). Chandler, AZ 85286
The 32 pixel image that foursquare uses for the venue.
The entire mini-venue response returned from foursquare.
It took a while for me to figure out all of the parts needed to create the jQuery plugin but overall I think it was worth it. Again this is my first venture into creating a jQuery plugin, so if it is way off, let me know.