Class EmailService
java.lang.Object
it.uniroma2.art.semanticturkey.email.EmailService
- Direct Known Subclasses:
ShowVocEmailService
,VbEmailService
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
formatBold
(String text) protected static String
formatItalic
(String text) protected static String
replaceAdminPlaceholders
(String text, STUser admin) Replaces references to (a specific) admin placeholders with the info about the given admin.protected static String
protected static String
replaceUserPlaceholders
(String text, STUser user) Replaces references to user placeholders with the info about the given user.void
Sends an email to the given address just for testing the email service configurationvoid
sendProjCreationMailToAdmin
(STUser creator, Project project) Sends an email to tha administrator users for notifying them that a project has been created (it doesn't send to the user who created)void
sendResetPasswordConfirmedMail
(STUser user, String tempPassword) Sends an email that informs the given user that its password has been replaced with the tempPasswordvoid
sendResetPasswordRequestedMail
(STUser user, String forgotPasswordLink) Sends an email that provides to the given user the info for resetting the password
-
Method Details
-
sendMailServiceConfigurationTest
public void sendMailServiceConfigurationTest(String mailTo) throws UnsupportedEncodingException, jakarta.mail.MessagingException, STPropertyAccessException Sends an email to the given address just for testing the email service configuration- Parameters:
mailTo
-- Throws:
UnsupportedEncodingException
jakarta.mail.MessagingException
STPropertyAccessException
-
sendResetPasswordConfirmedMail
public void sendResetPasswordConfirmedMail(STUser user, String tempPassword) throws UnsupportedEncodingException, jakarta.mail.MessagingException, STPropertyAccessException Sends an email that informs the given user that its password has been replaced with the tempPassword- Parameters:
user
-tempPassword
-- Throws:
UnsupportedEncodingException
jakarta.mail.MessagingException
STPropertyAccessException
-
sendResetPasswordRequestedMail
public void sendResetPasswordRequestedMail(STUser user, String forgotPasswordLink) throws UnsupportedEncodingException, jakarta.mail.MessagingException, STPropertyAccessException Sends an email that provides to the given user the info for resetting the password- Parameters:
user
-forgotPasswordLink
-- Throws:
UnsupportedEncodingException
jakarta.mail.MessagingException
STPropertyAccessException
-
sendProjCreationMailToAdmin
public void sendProjCreationMailToAdmin(STUser creator, Project project) throws UnsupportedEncodingException, jakarta.mail.MessagingException, STPropertyAccessException, UserException Sends an email to tha administrator users for notifying them that a project has been created (it doesn't send to the user who created)- Parameters:
creator
-project
-- Throws:
UnsupportedEncodingException
jakarta.mail.MessagingException
STPropertyAccessException
UserException
-
formatBold
-
formatItalic
-
replaceUserPlaceholders
Replaces references to user placeholders with the info about the given user. This must be used only in those email messages which content involves the user (e.g. user registered, account enabled, ..., so not in the email-service test message)- Parameters:
text
-user
-- Returns:
-
replaceAdminPlaceholders
Replaces references to (a specific) admin placeholders with the info about the given admin. This must be used only in those email messages which content involves the admin (e.g. user registered, ..., so not in emails toward the sole user (account enabled) or the email-service test message)- Parameters:
text
-admin
-- Returns:
-
replaceGenericPlaceholders
-