Browse Source

Emails finished

master
Mehrdadmaskull 10 years ago
parent
commit
7f1fe2df2e
5 changed files with 37 additions and 28 deletions
  1. +3
    -3
      Sevomin.Models/Helpers/SevominEmailer.cs
  2. +1
    -1
      Sevomin.WebFrontend.Controllers/AccountController.cs
  3. +5
    -4
      Sevomin.WebFrontend.Controllers/JobController.cs
  4. +4
    -5
      Sevomin.WebFrontend/Views/Account/ProfileDovomin.cshtml
  5. +24
    -15
      Sevomin.WebFrontend/Views/God/Index.cshtml

+ 3
- 3
Sevomin.Models/Helpers/SevominEmailer.cs View File

@ -76,17 +76,17 @@ namespace Sevomin.Models.Helpers
case EmailType.PasswordReset: case EmailType.PasswordReset:
template = template =
File.ReadAllText(PasswordResetFilePath, Encoding.UTF8); File.ReadAllText(PasswordResetFilePath, Encoding.UTF8);
msg.Subject = "بازنشانی رمز عبور";
msg.Subject = "بازیابی رمز عبور";
break; break;
case EmailType.ExpiringJob: case EmailType.ExpiringJob:
template = template =
File.ReadAllText(ExpiringJobFilePath, Encoding.UTF8); File.ReadAllText(ExpiringJobFilePath, Encoding.UTF8);
msg.Subject = عتبار کار در حال اتمام می باشد";
msg.Subject = تمام اعتبار آگهی";
break; break;
case EmailType.NewApplication: case EmailType.NewApplication:
template = template =
File.ReadAllText(NewApplicationFilePath, Encoding.UTF8); File.ReadAllText(NewApplicationFilePath, Encoding.UTF8);
msg.Subject = "اعلام آمادگی جدید برای فرصت شغلی اعلام شده";
msg.Subject = "آمادگی جدید";
break; break;
case EmailType.NewJob: case EmailType.NewJob:
template = template =


+ 1
- 1
Sevomin.WebFrontend.Controllers/AccountController.cs View File

@ -188,7 +188,7 @@ namespace Sevomin.WebFrontend.Controllers
await emailer.SendAsync(user.Email, true, false); await emailer.SendAsync(user.Email, true, false);
#endif #endif
ViewBag.Result = new PostResultViewModel(true, "آدرس بازنشانی رمز عبور برای شما ارسال شد.");
ViewBag.Result = new PostResultViewModel(true, "آدرس بازیابی رمز عبور برای شما ارسال شد.");
return View(); return View();
} }


+ 5
- 4
Sevomin.WebFrontend.Controllers/JobController.cs View File

@ -95,11 +95,12 @@ namespace Sevomin.WebFrontend.Controllers
try try
{ {
foreach (
var dovomin in UserRepository.Current.ListAll().Where(user => user is Dovomin && user.EmailConfirmed))
foreach (var dovomin in UserRepository.Current.ListAll().Where(user => user is Dovomin && user.EmailConfirmed))
{ {
SevominEmailer emailer = new SevominEmailer {EmailType = EmailType.NewJob}; SevominEmailer emailer = new SevominEmailer {EmailType = EmailType.NewJob};
emailer.Parameters.Add("display-name", dovomin.DisplayName); emailer.Parameters.Add("display-name", dovomin.DisplayName);
emailer.Parameters.Add("job-description", job.Description);
emailer.Parameters.Add("job-link", job.Id.ToString());
await emailer.SendAsync(dovomin.Email, true, ((Dovomin)dovomin).OptOutEmail); await emailer.SendAsync(dovomin.Email, true, ((Dovomin)dovomin).OptOutEmail);
} }
@ -272,11 +273,11 @@ namespace Sevomin.WebFrontend.Controllers
emailer.Parameters.Add("avalin-contact", string.IsNullOrWhiteSpace(dj.Job.ContactPersonName) ? "" : dj.Job.ContactPersonName); emailer.Parameters.Add("avalin-contact", string.IsNullOrWhiteSpace(dj.Job.ContactPersonName) ? "" : dj.Job.ContactPersonName);
emailer.Parameters.Add("dovomin-name", dj.Dovomin.DisplayName); emailer.Parameters.Add("dovomin-name", dj.Dovomin.DisplayName);
await emailer.SendAsync(job.Avalin.Email, true, true);
await emailer.SendAsync(job.Avalin.Email, true, false);
if (!string.IsNullOrWhiteSpace(dj.Job.ContactPersonEMail)) if (!string.IsNullOrWhiteSpace(dj.Job.ContactPersonEMail))
{ {
await emailer.SendAsync(dj.Job.ContactPersonEMail, true, user.OptOutEmail);
await emailer.SendAsync(dj.Job.ContactPersonEMail, true, false);
} }
} }
catch (Exception e) catch (Exception e)


+ 4
- 5
Sevomin.WebFrontend/Views/Account/ProfileDovomin.cshtml View File

@ -90,11 +90,10 @@
@Html.DisplayNameFor(model => model.IsPartTime) @Html.CheckBoxFor(model => model.IsPartTime) @Html.DisplayNameFor(model => model.IsPartTime) @Html.CheckBoxFor(model => model.IsPartTime)
</label> </label>
</div> </div>
<div class="row">
<div class="col-md-6">
@Html.LabelFor(model => model.OptOutEmail, new { @class = "col-md-3 col-md-push-9" })
@Html.CheckBox("OptOutEmail", (bool)ViewBag.OptOutEmail, new { @class = "col-md-2 col-md-push-5 checkbox" })
</div>
<div class="checkbox">
<label>
@Html.DisplayNameFor(model => model.OptOutEmail) @Html.CheckBox("OptOutEmail", (bool)ViewBag.OptOutEmail)
</label>
</div> </div>
</div> </div>
</div> </div>


+ 24
- 15
Sevomin.WebFrontend/Views/God/Index.cshtml View File

@ -51,31 +51,40 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p>برای تست: @(HttpContext.Current.Application["ApplicationStart"] == null ? "اجرا نشده" : (DateTime.Now - (DateTime)HttpContext.Current.Application["ApplicationStart"]).Minutes.ToString())</p>
<p>برای تست: @(HttpContext.Current.Application["ApplicationStart"] == null ? "اجرا نشده" : (DateTime.Now - (DateTime) HttpContext.Current.Application["ApplicationStart"]).Minutes.ToString())</p>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-stripped table-bordered"> <table class="table table-stripped table-bordered">
<thead> <thead>
<tr>
<th>تعداد کل اعضا</th>
<th>تعداد کارفرماها</th>
<th>تعداد متخصصین</th>
<th>تعداد فرصت های شغلی</th>
<th>تعداد اعلام آمادگی های فرصت های شغلی</th>
</tr>
<tr>
<th>تعداد کل اعضا</th>
<th>تعداد کارفرماها</th>
<th>تعداد متخصصین</th>
<th>تعداد فرصت های شغلی</th>
<th>تعداد اعلام آمادگی های فرصت های شغلی</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<td>@Sevomin.Models.SevominDbContext.Current.Users.Count() (دو روز اخیر: @Sevomin.Models.SevominDbContext.Current.Users.ToList().Where(u => u.SignUpDate.Date > DateTime.Now.Date.AddDays(-2)).Count())</td>
<td>@(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Avalin>().Count()) (دو روز اخیر: @(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Avalin>().ToList().Where(u => u.SignUpDate.Date > DateTime.Now.Date.AddDays(-2)).Count()))</td>
<td>@(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Dovomin>().Count()) (دو روز اخیر: @(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Dovomin>().ToList().Where(u => u.SignUpDate.Date > DateTime.Now.Date.AddDays(-2)).Count()))</td>
<td>@Sevomin.Models.SevominDbContext.Current.Jobs.Count()</td>
<td>@Sevomin.Models.SevominDbContext.Current.DovominJobs.Count() (دو روز اخیر: @Sevomin.Models.SevominDbContext.Current.DovominJobs.ToList().Where(j => j.ApplyDate.Date > DateTime.Now.Date.AddDays(-2)).Count())</td>
</tr>
<tr>
<td>@Sevomin.Models.SevominDbContext.Current.Users.Count() (دو روز اخیر: @Sevomin.Models.SevominDbContext.Current.Users.ToList().Where(u => u.SignUpDate.Date > DateTime.Now.Date.AddDays(-2)).Count())</td>
<td>@(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Avalin>().Count()) (دو روز اخیر: @(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Avalin>().ToList().Where(u => u.SignUpDate.Date > DateTime.Now.Date.AddDays(-2)).Count()))</td>
<td>@(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Dovomin>().Count()) (دو روز اخیر: @(Sevomin.Models.SevominDbContext.Current.Users.OfType<Sevomin.Models.Dovomin>().ToList().Where(u => u.SignUpDate.Date > DateTime.Now.Date.AddDays(-2)).Count()))</td>
<td>@Sevomin.Models.SevominDbContext.Current.Jobs.Count()</td>
<td>@Sevomin.Models.SevominDbContext.Current.DovominJobs.Count() (دو روز اخیر: @Sevomin.Models.SevominDbContext.Current.DovominJobs.ToList().Where(j => j.ApplyDate.Date > DateTime.Now.Date.AddDays(-2)).Count())</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12 rtl">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="ad-panel" href="#ad-panel-body">اضافه کردن آگهی در منوی کناری</a></h4>
</div>
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-12 rtl"> <div class="col-md-12 rtl">
<div class="panel panel-default" id="parameters-edit-panel"> <div class="panel panel-default" id="parameters-edit-panel">


Loading…
Cancel
Save