Skip to content

Commit

Permalink
+ Added additional checking in the PhotoSendRequest block to verify t…
Browse files Browse the repository at this point in the history
…he communication template and certain fields in the template (Fixes #798)
  • Loading branch information
nairdo committed Feb 4, 2015
1 parent f8f4a9b commit cc47358
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions RockWeb/Blocks/Crm/PhotoSendRequest.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ private void GetTemplateData()
if ( template != null )
{
var mediumData = template.MediumData;
if ( !mediumData.ContainsKey( "FromAddress" ) )
{
throw new Exception( string.Format( "The '{0}' communication template is missing a From address.", template.Name ) );
}

if ( !mediumData.ContainsKey( "Subject" ) )
{
mediumData.Add( "Subject", template.Subject );
Expand All @@ -435,6 +440,10 @@ private void GetTemplateData()
}
}
}
else
{
throw new Exception( "The communication template appears to be missing." );
}
}

/// <summary>
Expand Down

0 comments on commit cc47358

Please sign in to comment.