Sending Email Friendly SharePoint Designer HTML Emails

Sending HTML Emails can be frustrating when not done correctly. CSS formatting is lost when you view it inside your favorite email client. The level of support varies between email client but most of them works well with inline CSS. Now if you have finished creating you HTML Email you need to inline all your CSS. You can use Premailer for that. Premailer

  1. Go to Premailer
  2. Paste the HTML as the source. Make sure you use absolute URLs
  3. Copy the HTML result
  4. Use any text editor to replace all double quotes (“) into single quotes (‘)
  5. Minify your code. Minifying just means removing all line breaks and spaces. Minifying code is a must with SPD HTML Emails. There’s a lot of online tools, and prettydiff is one, that can you help you do this. NotePad++ has this too by Menu->Edit->Blank Operations-> Remove Unnecessary Blanks and EOL.

Minifying code is a must with SPD HTML Emails. There’s a lot of online tools, and prettydiff is one, that can you help you do this. NotePad++ has this too by Menu->Edit->Blank Operations-> Remove Unnecessary Blanks and EOL.

That’s it! Follow my blog article SharePoint 2010 Designer HTML Emails.

SharePoint 2010 Designer HTML Emails

There are many reasons why you’ll want to send emails in html. With html email you can have better looking emails with better formatting and pictures. In my case, I need to add the version number on the SharePoint Alert email. I can add the version number to the email so I figured I can just make it look like the SP Alert email instead.

  1. Click on the Email workflow step.
  2. Click on Advanced Properties.
  3. On the Send an Email Properties popup click on the Body, then on the ellipsis button.
  4. The String Builder window opens. Paste the html and click OK button.

SPD_Html_Emails

Related Article:

Microsoft.SharePoint.SPEndpointAddressNotFoundException: There are no addresses available for this application

Microsoft.SharePoint.SPEndpointAddressNotFoundException: There are no addresses available for this application.  
 at Microsoft.Office.Server.Search.Internal.UI.SearchAdminPageBase.ErrorHandler(Object sender, EventArgs e)    
 at System.Web.UI.TemplateControl.OnError(EventArgs e)   
 at System.Web.UI.Page.HandleError(Exception e)   
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
 at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
 at System.Web.UI.Page.ProcessRequest()   
 at System.Web.UI.Page.ProcessRequest(HttpContext context)   
 at ASP._layouts_viewscopes_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\f9763a27\ff293fc2\App_Web_viewscopes.aspx.2a428413.q50wkr7w.0.cs:line 0   
 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
To fix this go to SPCA -> Manage Services on Server and make sure the Search Query and Site Settings Service is Started

Creating Scope Rules on SearchScopes using PowerShell

I happened to maintain around 200 rules on 4 search scopes. Adding rules to Search Scopes is a slow process so I use this script to do it.

$scopeName = 'TestScopeName'
$siteUrl = 'http://intranet.contoso.com'
$searchSvcApp = 'Search Service Application'
$site= Get-SPSite $siteUrl
$searchContext = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($site)
$scopes = New-Object Microsoft.Office.Server.Search.Administration.Scopes($searchContext)
$myscope = $scopes.GetScope($siteUrl, $scopeName)
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity $searchSvcApp

And now to actually add the rule to the search scope.

New-SPEnterpriseSearchQueryScopeRule -Url $siteUrl -Scope $myscope -RuleType Url -UrlScopeRuleType Folder -FilterBehavior Include -MatchingString 'http://intranet.contoso.com/ListOrLibraryName/' -SearchApplication $ssa
Test Search Scope Name

Test Search Scope Name

TaxonomyPicker Error on Event Logs

I always see this error on the logs. Though harmless it’s also useless.

TaxonomyPicker Error on Windows Event Logs

TaxonomyPicker Error on Windows Event Logs

To stop seeing this error just rename the TaxonomyPicker.ascx to something else.

cd "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES"
ren TaxonomyPicker.ascx TaxonomyPicker.ascx_useless

How to Find a Feature using GUID

Suppose you’re creating a site and encountered an error like this.

You want to know what feature it is missing by using the GUID. Here’s how using PowerShell.

Get-SPFeature -Identity enter_guid_without_braces.

 Get-SPFeature -Identity d5191a77-fa2d-4801-9baf-9f4205c9e9d2

And if you want just a list of all features run the command without parameters.

Get-SPFeature