Browse Source

minor hiccups

master
Milad Karbasizadeh 11 years ago
parent
commit
f23d86f872
3 changed files with 8 additions and 14 deletions
  1. +4
    -12
      Sevomin.Models/Helpers/SevominEmailer.cs
  2. +1
    -1
      Sevomin.WebFrontend/Global.asax.cs
  3. +3
    -1
      Sevomin.WebFrontend/Sevomin.WebFrontend.csproj

+ 4
- 12
Sevomin.Models/Helpers/SevominEmailer.cs View File

@ -23,8 +23,7 @@ namespace Sevomin.Models.Helpers
public Dictionary<string, string> Parameters { get; set; } public Dictionary<string, string> Parameters { get; set; }
public EmailType EmailType { get; set; } public EmailType EmailType { get; set; }
private string EmailFolderPath; private string EmailFolderPath;
private string EmailConfirmationFilePath;
private string NewPasswordFilePath;
private string EmailConfirmationFilePath;
private string PasswordResetFilePath; private string PasswordResetFilePath;
private string ExpiringJobFilePath; private string ExpiringJobFilePath;
private string NewJobFilePath; private string NewJobFilePath;
@ -34,16 +33,13 @@ namespace Sevomin.Models.Helpers
EmailFolderPath = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/app_data"), "emails"); EmailFolderPath = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/app_data"), "emails");
if (!Directory.Exists(EmailFolderPath)) if (!Directory.Exists(EmailFolderPath))
throw new ApplicationException("Emails folder does not exist in the right address."); throw new ApplicationException("Emails folder does not exist in the right address.");
EmailConfirmationFilePath = Path.Combine(EmailFolderPath, "email-confirmation.html");
NewPasswordFilePath = Path.Combine(EmailFolderPath, "new-password.html");
EmailConfirmationFilePath = Path.Combine(EmailFolderPath, "email-confirmation.html");
PasswordResetFilePath = Path.Combine(EmailFolderPath, "password-reset.html"); PasswordResetFilePath = Path.Combine(EmailFolderPath, "password-reset.html");
ExpiringJobFilePath = Path.Combine(EmailFolderPath, "expiring-job.html"); ExpiringJobFilePath = Path.Combine(EmailFolderPath, "expiring-job.html");
NewJobFilePath = Path.Combine(EmailFolderPath, "new-job.html"); NewJobFilePath = Path.Combine(EmailFolderPath, "new-job.html");
NewApplicationFilePath = Path.Combine(EmailFolderPath, "new-application.html"); NewApplicationFilePath = Path.Combine(EmailFolderPath, "new-application.html");
if(!File.Exists(EmailConfirmationFilePath)) if(!File.Exists(EmailConfirmationFilePath))
throw new ApplicationException("Email confirmation template does not exist in the right address.");
if (!File.Exists(NewPasswordFilePath))
throw new ApplicationException("New password template does not exist in the right address.");
throw new ApplicationException("Email confirmation template does not exist in the right address.");
if (!File.Exists(PasswordResetFilePath)) if (!File.Exists(PasswordResetFilePath))
throw new ApplicationException("Password reset template does not exist in the right address."); throw new ApplicationException("Password reset template does not exist in the right address.");
if (!File.Exists(ExpiringJobFilePath)) if (!File.Exists(ExpiringJobFilePath))
@ -74,11 +70,7 @@ namespace Sevomin.Models.Helpers
case EmailType.PasswordReset: case EmailType.PasswordReset:
template = template =
File.ReadAllText(PasswordResetFilePath, Encoding.UTF8); File.ReadAllText(PasswordResetFilePath, Encoding.UTF8);
break;
case EmailType.NewPassword:
template =
File.ReadAllText(NewPasswordFilePath, Encoding.UTF8);
break;
break;
case EmailType.ExpiringJob: case EmailType.ExpiringJob:
template = template =
File.ReadAllText(ExpiringJobFilePath, Encoding.UTF8); File.ReadAllText(ExpiringJobFilePath, Encoding.UTF8);


+ 1
- 1
Sevomin.WebFrontend/Global.asax.cs View File

@ -18,7 +18,7 @@ namespace Sevomin.WebFrontend
AreaRegistration.RegisterAllAreas(); AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes); RouteConfig.RegisterRoutes(RouteTable.Routes);
TaskManager.Initialize(new SevominRegistry());
//TaskManager.Initialize(new SevominRegistry());
} }
void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e) void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e)


+ 3
- 1
Sevomin.WebFrontend/Sevomin.WebFrontend.csproj View File

@ -125,8 +125,10 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="App_Data\emails\new-application.html" />
<Content Include="App_Data\emails\new-job.html" />
<Content Include="App_Data\emails\expring-job.html" />
<Content Include="App_Data\emails\password-reset.html" /> <Content Include="App_Data\emails\password-reset.html" />
<Content Include="App_Data\emails\new-password.html" />
<Content Include="App_Data\emails\email-confirmation.html" /> <Content Include="App_Data\emails\email-confirmation.html" />
<Content Include="app_offline-.htm" /> <Content Include="app_offline-.htm" />
<Content Include="Content\bootstrap-theme.css" /> <Content Include="Content\bootstrap-theme.css" />


Loading…
Cancel
Save