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 @@
- +
- + The Name or IP address of the host used for SMTP transactions. @@ -14,12 +14,12 @@
- +
- + - + The port to be used on host. @@ -30,9 +30,9 @@
- -
@@ -42,26 +42,26 @@
- +
- + - + - The username used to authenticate the sender. + The username used to authenticate the sender. Read the help section for information about advanced formatting.
- +
- + The password used to authenticate the sender. @@ -70,58 +70,58 @@
- +
- + - + - The email is sent from? + The email sending address. Read the help section for information about advanced formatting.
- +
- + - + - The email will be sent to? + The email message will be sent to. Read the help section for information about advanced formatting.
- +
- + - The subject line for this e-mail message. + The subject line for this email message. Read the help section for information about advanced formatting.
- +
- + - The message body + The message body. Read the help section for information about advanced formatting.
diff --git a/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.ts b/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.ts index ca28aebd1..401d49315 100644 --- a/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.ts +++ b/src/Squidex/app/features/rules/pages/rules/actions/email-action.component.ts @@ -24,47 +24,47 @@ export class EmailActionComponent implements OnInit { public actionFormSubmitted = false; public ngOnInit() { - this.actionForm.setControl('host', - new FormControl(this.action.host || 'smtp.gmail.com', [ + this.actionForm.setControl('serverHost', + new FormControl(this.action.serverHost || 'smtp.gmail.com', [ Validators.required ])); - this.actionForm.setControl('port', - new FormControl(this.action.port || 465, [ + this.actionForm.setControl('serverPort', + new FormControl(this.action.serverPort || 465, [ Validators.required, Validators.pattern(/\d{2,6}/) ])); - this.actionForm.setControl('enableSsl', - new FormControl(this.action.enableSsl || true)); + this.actionForm.setControl('serverUseSsl', + new FormControl(this.action.serverUseSsl || true)); - this.actionForm.setControl('username', - new FormControl(this.action.username || '', [ + this.actionForm.setControl('serverUsername', + new FormControl(this.action.serverUsername || '', [ Validators.required ])); - this.actionForm.setControl('password', - new FormControl(this.action.password || '', [ + this.actionForm.setControl('serverPassword', + new FormControl(this.action.serverPassword || '', [ Validators.required ])); - this.actionForm.setControl('from', - new FormControl(this.action.from || '', [ + this.actionForm.setControl('messageFrom', + new FormControl(this.action.messageFrom || '', [ Validators.required ])); - this.actionForm.setControl('to', - new FormControl(this.action.to || '', [ + this.actionForm.setControl('messageTo', + new FormControl(this.action.messageTo || '', [ Validators.required ])); - this.actionForm.setControl('subject', - new FormControl(this.action.subject || '', [ + this.actionForm.setControl('messageSubject', + new FormControl(this.action.messageSubject || '', [ Validators.required ])); - this.actionForm.setControl('body', - new FormControl(this.action.body || '', [ + this.actionForm.setControl('messageBody', + new FormControl(this.action.messageBody || '', [ Validators.required ])); } diff --git a/src/Squidex/appsettings.json b/src/Squidex/appsettings.json index 1b571af54..cf56a9497 100644 --- a/src/Squidex/appsettings.json +++ b/src/Squidex/appsettings.json @@ -68,8 +68,8 @@ /* * The maximum number of megabyte that the process can consume until it is marked as not healthy. */ - "threshold": 4096 - } + "threshold": 4096 + } }, "contentsController": { @@ -78,13 +78,13 @@ * * Nginx Has problems with long headers. It might make sense to disable this feature if you do not use a CDN. */ - "enableSurrogateKeys": true, + "enableSurrogateKeys": true, - /* + /* * Restrict the surrogate keys to results that have less than 200 items. */ - "maxItemsForSurrogateKeys": 200 - }, + "maxItemsForSurrogateKeys": 200 + }, "content": { /*