This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
generated from halo-dev/plugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
44 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
38 changes: 30 additions & 8 deletions
38
src/main/java/io/mvvm/halo/plugins/email/support/MailServerConfig.java
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,26 +1,48 @@ | ||
package io.mvvm.halo.plugins.email.support; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import org.springframework.boot.autoconfigure.mail.MailProperties; | ||
|
||
/** | ||
* MailConfig. | ||
* | ||
* @author: pan | ||
**/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class MailServerConfig extends MailProperties { | ||
public class MailServerConfig { | ||
|
||
public static final String NAME = "mail-settings"; | ||
public static final String GROUP = "basic"; | ||
|
||
private boolean enable; | ||
|
||
/** | ||
* SMTP server host. For instance, 'smtp.example.com'. | ||
*/ | ||
private String host; | ||
|
||
/** | ||
* SMTP server port. | ||
*/ | ||
private Integer port; | ||
|
||
/** | ||
* Login user of the SMTP server. | ||
*/ | ||
private String username; | ||
|
||
/** | ||
* Login password of the SMTP server. | ||
*/ | ||
private String password; | ||
|
||
/** | ||
* Protocol used by the SMTP server. | ||
*/ | ||
private String protocol = "smtp"; | ||
|
||
private boolean enable = true; | ||
|
||
private String adminMail; | ||
|
||
private String fromName; | ||
|
||
private boolean enableTls; | ||
private boolean enableTls = false; | ||
} |
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 |
---|---|---|
|
@@ -11,42 +11,44 @@ spec: | |
help: "测试连接打开地址: http://ip:port/apis/io.mvvm.halo.plugins.email/testConnection" | ||
label: 启用邮件通知 | ||
name: enable | ||
value: false | ||
value: true | ||
- $formkit: text | ||
label: 管理员邮箱 | ||
name: adminMail | ||
validation: required | ||
help: "有评论需要审核时会通知此邮箱" | ||
- $formkit: text | ||
label: FromName | ||
name: fromName | ||
validation: required | ||
help: "发送邮箱时展示的名称" | ||
- $formkit: text | ||
help: smtp.qq.com. | ||
help: "邮件服务器地址。如QQ邮箱:smtp.qq.com." | ||
label: Host | ||
name: host | ||
validation: required | ||
- $formkit: text | ||
help: 465. | ||
help: "邮件服务器端口。如TSL:465." | ||
label: Port | ||
name: port | ||
validation: required | ||
- $formkit: text | ||
help: username. | ||
help: "邮件服务器的账号。如:[email protected]." | ||
label: Username | ||
name: username | ||
validation: required | ||
- $formkit: text | ||
help: password. | ||
help: " 邮件服务器的密码。非邮件的登陆密码." | ||
label: Password | ||
name: password | ||
validation: required | ||
- $formkit: text | ||
help: smtps, smtp. | ||
help: "邮件服务器的协议。如:smtps, smtp." | ||
label: Protocol | ||
name: protocol | ||
validation: required | ||
- $formkit: checkbox | ||
help: enableTls. | ||
label: Tls | ||
help: "是否开启TLS." | ||
label: TLS | ||
name: enableTls | ||
value: false |