new voucher system + jdoc
This commit is contained in:
@@ -10,8 +10,7 @@ import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author _bastler@bstly.de
|
||||
*
|
||||
* The Class EmailManager.
|
||||
*/
|
||||
@Component
|
||||
public class EmailManager {
|
||||
@@ -19,6 +18,15 @@ public class EmailManager {
|
||||
@Autowired
|
||||
private JavaMailSender javaMailSender;
|
||||
|
||||
/**
|
||||
* Send text.
|
||||
*
|
||||
* @param to the to
|
||||
* @param from the from
|
||||
* @param subject the subject
|
||||
* @param text the text
|
||||
* @return the mail message
|
||||
*/
|
||||
public MailMessage sendText(String to, String from, String subject, String text) {
|
||||
SimpleMailMessage message = new SimpleMailMessage();
|
||||
message.setFrom(from);
|
||||
@@ -30,6 +38,15 @@ public class EmailManager {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send bcc.
|
||||
*
|
||||
* @param bcc the bcc
|
||||
* @param from the from
|
||||
* @param subject the subject
|
||||
* @param text the text
|
||||
* @return the mail message
|
||||
*/
|
||||
public MailMessage sendBcc(String[] bcc, String from, String subject, String text) {
|
||||
SimpleMailMessage message = new SimpleMailMessage();
|
||||
message.setFrom(from);
|
||||
|
||||
@@ -30,8 +30,7 @@ import de.bstly.we.model.User;
|
||||
import de.bstly.we.model.UserProfileField;
|
||||
|
||||
/**
|
||||
* @author _bastler@bstly.de
|
||||
*
|
||||
* The Class EmailController.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/email")
|
||||
@@ -47,9 +46,10 @@ public class EmailController extends BaseController {
|
||||
private UserProfileFieldManager userProfileFieldManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param to
|
||||
* @return
|
||||
* Send test.
|
||||
*
|
||||
* @param to the to
|
||||
* @return the mail message
|
||||
*/
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@PostMapping("/test")
|
||||
@@ -58,6 +58,11 @@ public class EmailController extends BaseController {
|
||||
"Test from we.bstly");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user mail list.
|
||||
*
|
||||
* @return the user mail list
|
||||
*/
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@GetMapping("/list")
|
||||
public List<UserMailModel> getUserMailList() {
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
package de.bstly.we.email.controller.model;
|
||||
|
||||
/**
|
||||
* @author _bastler@bstly.de
|
||||
*
|
||||
* The Class UserMailModel.
|
||||
*/
|
||||
public class UserMailModel {
|
||||
|
||||
@@ -14,8 +13,10 @@ public class UserMailModel {
|
||||
private String locale;
|
||||
|
||||
/**
|
||||
* @param username
|
||||
* @param email
|
||||
* Instantiates a new user mail model.
|
||||
*
|
||||
* @param username the username
|
||||
* @param email the email
|
||||
*/
|
||||
public UserMailModel(String username, String email) {
|
||||
super();
|
||||
@@ -24,6 +25,8 @@ public class UserMailModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the username.
|
||||
*
|
||||
* @return the username
|
||||
*/
|
||||
public String getUsername() {
|
||||
@@ -31,13 +34,17 @@ public class UserMailModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param username the username to set
|
||||
* Sets the username.
|
||||
*
|
||||
* @param username the new username
|
||||
*/
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the email.
|
||||
*
|
||||
* @return the email
|
||||
*/
|
||||
public String getEmail() {
|
||||
@@ -45,13 +52,17 @@ public class UserMailModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param email the email to set
|
||||
* Sets the email.
|
||||
*
|
||||
* @param email the new email
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the locale.
|
||||
*
|
||||
* @return the locale
|
||||
*/
|
||||
public String getLocale() {
|
||||
@@ -59,7 +70,9 @@ public class UserMailModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param locale the locale to set
|
||||
* Sets the locale.
|
||||
*
|
||||
* @param locale the new locale
|
||||
*/
|
||||
public void setLocale(String locale) {
|
||||
this.locale = locale;
|
||||
|
||||
Reference in New Issue
Block a user