Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from novuhq/69-cannot-set-layout-on-a-step-email
feat: add layout to step message templates # 69
- Loading branch information
Showing
5 changed files
with
55 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 19 additions & 9 deletions
28
src/Novu/Models/Workflows/Step/Message/IMessageTemplate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Novu.Models.Workflows.Step.Message; | ||
|
||
public interface IMessageTemplate | ||
{ | ||
[JsonProperty("type")] | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
StepTypeEnum Type { get; set; } | ||
|
||
/// <summary> | ||
/// Polymorphic between string (code) and typed EmailBlock[] | ||
/// </summary> | ||
object Content { get; set; } | ||
|
||
[JsonProperty("contentType")] | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
MessageTemplateContentType ContentType { get; set; } | ||
|
||
[JsonProperty("deleted")] bool Deleted { get; set; } | ||
bool Deleted { get; set; } | ||
|
||
TemplateVariable[] Variables { get; set; } | ||
|
||
/// <summary> | ||
/// Layout has three lifecycles (create, update and read) and the create and update use the non-underscore | ||
/// whereas the read uses underscore. | ||
/// | ||
/// The problems lies that these are nested objects that the API doesn't create as sub-resources to manage. | ||
/// | ||
/// Therefore the implementation must deal with READ/WRITE in situ. | ||
/// </summary> | ||
/// <remarks> | ||
/// The same problem for <see cref="FeedId"/> | ||
/// </remarks> | ||
public string? LayoutId { get; set; } | ||
// ReSharper disable once InconsistentNaming | ||
public string? _layoutId { get; set; } | ||
|
||
[JsonProperty("variables")] TemplateVariable[] Variables { get; set; } | ||
public Actor Actor { get; set; } | ||
} |