mailling template key
This commit is contained in:
parent
45d76a2917
commit
acdec2b6f7
12 changed files with 3141 additions and 110 deletions
|
|
@ -23,17 +23,17 @@ namespace Yavsc.Server.Models.EMailing
|
|||
set;
|
||||
}
|
||||
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
[Key][MaxLength(256),MinLength(3)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[MaxLengthAttribute(128),MinLength(3)]
|
||||
[MaxLength(256),MinLength(3)]
|
||||
public string Topic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Markdown template to process
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[MaxLengthAttribute(64*1024)]
|
||||
[MaxLength(64*1024)]
|
||||
public string Body { get; set; }
|
||||
|
||||
[EmailAddress()]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Abstract.Templates;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Templates
|
||||
{
|
||||
public static class TemplateConstants
|
||||
{
|
||||
public static readonly Dictionary<string, Func<ApplicationUser, bool>> Criterias =
|
||||
new Dictionary<string, Func<ApplicationUser, bool>>
|
||||
{
|
||||
{ "allow-monthly", u => u.AllowMonthlyEmail },
|
||||
{ "email-not-confirmed", u => !u.EmailConfirmed && u.DateCreated < DateTime.Now.AddDays(-7) }
|
||||
};
|
||||
}
|
||||
|
||||
public abstract class UserOrientedTemplate: Template
|
||||
{
|
||||
public ApplicationUser User { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue