// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.ComponentModel.DataAnnotations; using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.Rules; using Squidex.Infrastructure.Validation; namespace Squidex.Extensions.Actions.Email { [RuleAction( Title = "Email", IconImage = "", IconColor = "#333300", Display = "Send an email", Description = "Send an email with a custom SMTP server.", ReadMore = "https://en.wikipedia.org/wiki/Email")] public sealed record EmailAction : RuleAction { [LocalizedRequired] [Display(Name = "Server Host", Description = "The IP address or host to the SMTP server.")] [Editor(RuleFieldEditor.Text)] public string ServerHost { get; set; } [LocalizedRequired] [Display(Name = "Server Port", Description = "The port to the SMTP server.")] [Editor(RuleFieldEditor.Text)] public int ServerPort { get; set; } [LocalizedRequired] [Display(Name = "Username", Description = "The username for the SMTP server.")] [Editor(RuleFieldEditor.Text)] [Formattable] public string ServerUsername { get; set; } [LocalizedRequired] [Display(Name = "Password", Description = "The password for the SMTP server.")] [Editor(RuleFieldEditor.Password)] public string ServerPassword { get; set; } [LocalizedRequired] [Display(Name = "From Address", Description = "The email sending address.")] [Editor(RuleFieldEditor.Text)] [Formattable] public string MessageFrom { get; set; } [LocalizedRequired] [Display(Name = "To Address", Description = "The email message will be sent to.")] [Editor(RuleFieldEditor.Text)] [Formattable] public string MessageTo { get; set; } [LocalizedRequired] [Display(Name = "Subject", Description = "The subject line for this email message.")] [Editor(RuleFieldEditor.Text)] [Formattable] public string MessageSubject { get; set; } [LocalizedRequired] [Display(Name = "Body", Description = "The message body.")] [Editor(RuleFieldEditor.TextArea)] [Formattable] public string MessageBody { get; set; } } }