diff --git a/extensions/Squidex.Extensions/Actions/Email/EmailAction.cs b/extensions/Squidex.Extensions/Actions/Email/EmailAction.cs index 38a67eb8c..f2af64af8 100644 --- a/extensions/Squidex.Extensions/Actions/Email/EmailAction.cs +++ b/extensions/Squidex.Extensions/Actions/Email/EmailAction.cs @@ -20,39 +20,39 @@ namespace Squidex.Extensions.Actions.Email public class EmailAction : RuleAction { [Required] - [Display(Name = "Host", Description = "The Name or IP address of the host used for SMTP transactions.")] - public string Host { get; set; } + [Display(Name = "ServerHost", Description = "The Name or IP address of the host used for SMTP transactions.")] + public string ServerHost { get; set; } [Required] - [Display(Name = "Port", Description = "The port to be used on host.")] - public int Port { get; set; } + [Display(Name = "ServerPort", Description = "The port to be used on host.")] + public int ServerPort { get; set; } [Required] - [Display(Name = "EnableSsl", Description = "Specify whether the smtp client uses Secure Sockets Layer (SSL) to encrypt the connection.")] - public bool EnableSsl { get; set; } + [Display(Name = "ServerUseSsl", Description = "Specify whether the smtp client uses Secure Sockets Layer (SSL) to encrypt the connection.")] + public bool ServerUseSsl { get; set; } [Required] - [Display(Name = "Username", Description = "The username used to authenticate the sender.")] - public string Username { get; set; } + [Display(Name = "ServerUsername", Description = "The username used to authenticate the sender.")] + public string ServerUsername { get; set; } [Required] - [Display(Name = "Password", Description = "The password used to authenticate the sender.")] - public string Password { get; set; } + [Display(Name = "ServerPassword", Description = "The password used to authenticate the sender.")] + public string ServerPassword { get; set; } [Required] - [Display(Name = "From", Description = "The email is sent from?")] - public string From { get; set; } + [Display(Name = "MessageFrom", Description = "The email sending address.")] + public string MessageFrom { get; set; } [Required] - [Display(Name = "To", Description = "The email will be sent to?")] - public string To { get; set; } + [Display(Name = "MessageTo", Description = "The email message will be sent to.")] + public string MessageTo { get; set; } [Required] - [Display(Name = "Subject", Description = "The subject line for this e-mail message.")] - public string Subject { get; set; } + [Display(Name = "MessageSubject", Description = "The subject line for this email message.")] + public string MessageSubject { get; set; } [Required] - [Display(Name = "Body", Description = "The message body.")] - public string Body { get; set; } + [Display(Name = "MessageBody", Description = "The message body.")] + public string MessageBody { get; set; } } } diff --git a/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs b/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs index 6f5f9227d..f15e8a90e 100644 --- a/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs +++ b/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs @@ -31,15 +31,15 @@ namespace Squidex.Extensions.Actions.Email { var ruleJob = new EmailJob { - Host = action.Host, - EnableSsl = action.EnableSsl, - Password = action.Password, - Port = action.Port, - Username = Format(action.Username, @event), - From = Format(action.From, @event), - To = Format(action.To, @event), - Subject = Format(action.Subject, @event), - Body = Format(action.Body, @event) + ServerHost = action.ServerHost, + ServerUseSsl = action.ServerUseSsl, + ServerPassword = action.ServerPassword, + ServerPort = action.ServerPort, + ServerUsername = Format(action.ServerUsername, @event), + MessageFrom = Format(action.MessageFrom, @event), + MessageTo = Format(action.MessageTo, @event), + MessageSubject = Format(action.MessageSubject, @event), + MessageBody = Format(action.MessageBody, @event) }; return (Description, ruleJob); @@ -47,15 +47,15 @@ namespace Squidex.Extensions.Actions.Email protected override async Task<(string Dump, Exception Exception)> ExecuteJobAsync(EmailJob job) { - using (var client = new SmtpClient(job.Host, job.Port)) + using (var client = new SmtpClient(job.ServerHost, job.ServerPort)) { - client.EnableSsl = job.EnableSsl; - client.Credentials = new NetworkCredential(job.Username, job.Password); + client.EnableSsl = job.ServerUseSsl; + client.Credentials = new NetworkCredential(job.ServerUsername, job.ServerPassword); - using (var message = new MailMessage(job.From, job.To)) + using (var message = new MailMessage(job.MessageFrom, job.MessageTo)) { - message.Subject = job.Subject; - message.Body = job.Body; + message.Subject = job.MessageSubject; + message.Body = job.MessageBody; await client.SendMailAsync(message); } } @@ -66,22 +66,22 @@ namespace Squidex.Extensions.Actions.Email public class EmailJob { - public string Host { get; set; } + public string ServerHost { get; set; } - public int Port { get; set; } + public int ServerPort { get; set; } - public string Username { get; set; } + public string ServerUsername { get; set; } - public string Password { get; set; } + public string ServerPassword { get; set; } - public bool EnableSsl { get; set; } + public bool ServerUseSsl { get; set; } - public string From { get; set; } + public string MessageFrom { get; set; } - public string To { get; set; } + public string MessageTo { get; set; } - public string Subject { get; set; } + public string MessageSubject { get; set; } - public string Body { get; set; } + public string MessageBody { get; set; } } } diff --git a/src/Squidex/AppServices.cs b/src/Squidex/AppServices.cs index eef4b3c9f..c880e9e1f 100644 --- a/src/Squidex/AppServices.cs +++ b/src/Squidex/AppServices.cs @@ -16,7 +16,6 @@ using Squidex.Config.Domain; using Squidex.Config.Web; using Squidex.Domain.Apps.Entities.Assets; using Squidex.Domain.Apps.Entities.Contents; -using Squidex.Extensions.Actions.Email; using Squidex.Extensions.Actions.Twitter; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Diagnostics; diff --git a/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.html b/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.html index 9b7c57a77..04d6c64e7 100644 --- a/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.html +++ b/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.html @@ -1,11 +1,11 @@