Package com.axemble.vdoc.sdk.mail
Class DefaultSystemMailExtension
java.lang.Object
com.axemble.vdoc.sdk.mail.DefaultSystemMailExtension
- All Implemented Interfaces:
ISystemMailExtension
Default mail extension for password management
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.axemble.vdoc.core.services.ConfigurationService
protected final com.axemble.vdp.localization.structures.LocalizationService
static final String
-
Constructor Summary
ConstructorDescriptionRuntime constructor with default dependenciesDefaultSystemMailExtension
(com.axemble.vdp.localization.structures.LocalizationService localizationService, com.axemble.vdoc.core.services.ConfigurationService configurationService) Constructor with dependency injection -
Method Summary
Modifier and TypeMethodDescriptionfinal jakarta.mail.internet.MimeMessage
buildLostPasswordMessage
(LostPasswordConfiguration configuration) Build mail with redirect url to the confirm screen.jakarta.mail.internet.MimeMessage
build new account messagefinal jakarta.mail.internet.MimeMessage
buildUpdatePasswordMessage
(UpdatePasswordConfiguration configuration) Build mail with newly generated passwordstatic boolean
canBeContacted
(IUser user) Test if a user have a valid email adressRetrieve the default email colorRetrieve the default email link colorRetrieve the default email logoRetrieve the default login page URLretrieveLostPasswordLink
(LostPasswordConfiguration configuration) Retrieve the URL for lost passwordRetrieve the URL for uninitialized passwordretrieveUpdatedPasswordPasswordLink
(UpdatePasswordConfiguration configuration) Retrieve the URL for updated password confirmationprotected void
setNewPasswordMessage
(jakarta.mail.internet.MimeMessage mimeMessage, UpdatePasswordConfiguration configuration) protected void
setUninitializedPasswordMessage
(jakarta.mail.internet.MimeMessage mimeMessage, UninitializedPasswordConfiguration configuration)
-
Field Details
-
TEXT_PLAIN
- See Also:
-
localizationService
protected final com.axemble.vdp.localization.structures.LocalizationService localizationService -
configurationService
protected final com.axemble.vdoc.core.services.ConfigurationService configurationService
-
-
Constructor Details
-
DefaultSystemMailExtension
public DefaultSystemMailExtension()Runtime constructor with default dependencies -
DefaultSystemMailExtension
public DefaultSystemMailExtension(com.axemble.vdp.localization.structures.LocalizationService localizationService, com.axemble.vdoc.core.services.ConfigurationService configurationService) Constructor with dependency injection- Parameters:
localizationService
- how to resolve static string.configurationService
- configuration service
-
-
Method Details
-
canBeContacted
Test if a user have a valid email adress- Parameters:
user
- user- Returns:
- true if user can be contacted (valid email address) else false
-
setNewPasswordMessage
protected void setNewPasswordMessage(jakarta.mail.internet.MimeMessage mimeMessage, UpdatePasswordConfiguration configuration) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
setUninitializedPasswordMessage
protected void setUninitializedPasswordMessage(jakarta.mail.internet.MimeMessage mimeMessage, UninitializedPasswordConfiguration configuration) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
buildLostPasswordMessage
public final jakarta.mail.internet.MimeMessage buildLostPasswordMessage(LostPasswordConfiguration configuration) throws jakarta.mail.MessagingException Build mail with redirect url to the confirm screen.- Specified by:
buildLostPasswordMessage
in interfaceISystemMailExtension
- Parameters:
configuration
- the lost password mail configuration- Returns:
- the mime message with body, to and from
- Throws:
jakarta.mail.MessagingException
- if there is a problem with mime message
-
buildUpdatePasswordMessage
public final jakarta.mail.internet.MimeMessage buildUpdatePasswordMessage(UpdatePasswordConfiguration configuration) throws ExternalUserException, NonContactableUserException, jakarta.mail.MessagingException Build mail with newly generated password- Specified by:
buildUpdatePasswordMessage
in interfaceISystemMailExtension
- Parameters:
configuration
- the mail configuration- Returns:
- the mime message with body, to and from
- Throws:
ExternalUserException
- if user is externalNonContactableUserException
- if user haven't mailjakarta.mail.MessagingException
- if there is a problem with mime message
-
buildUninitializedPasswordMessage
public jakarta.mail.internet.MimeMessage buildUninitializedPasswordMessage(UninitializedPasswordConfiguration configuration) throws jakarta.mail.MessagingException, NonContactableUserException Description copied from interface:ISystemMailExtension
build new account message- Specified by:
buildUninitializedPasswordMessage
in interfaceISystemMailExtension
- Parameters:
configuration
-UninitializedPasswordConfiguration
- Returns:
- mime message to send
- Throws:
jakarta.mail.MessagingException
- if there is a problem with mime messageNonContactableUserException
- if user haven't mail
-
retrieveDefaultEmailLogo
Description copied from interface:ISystemMailExtension
Retrieve the default email logo- Specified by:
retrieveDefaultEmailLogo
in interfaceISystemMailExtension
- Parameters:
user
- the current user who will receive a mail- Returns:
- the logo path
-
retrieveDefaultEmailColor
Description copied from interface:ISystemMailExtension
Retrieve the default email color- Specified by:
retrieveDefaultEmailColor
in interfaceISystemMailExtension
- Parameters:
user
- the current user who will receive a mail- Returns:
- the hexadecimal color code
-
retrieveDefaultEmailLinkColor
Description copied from interface:ISystemMailExtension
Retrieve the default email link color- Specified by:
retrieveDefaultEmailLinkColor
in interfaceISystemMailExtension
- Parameters:
user
- the current user who will receive a mail- Returns:
- the hexadecimal color code
-
retrieveUninitializedPasswordLink
Description copied from interface:ISystemMailExtension
Retrieve the URL for uninitialized password- Specified by:
retrieveUninitializedPasswordLink
in interfaceISystemMailExtension
- Parameters:
configuration
- the configuration- Returns:
- the full link
-
retrieveLostPasswordLink
Description copied from interface:ISystemMailExtension
Retrieve the URL for lost password- Specified by:
retrieveLostPasswordLink
in interfaceISystemMailExtension
- Parameters:
configuration
- the configuration- Returns:
- the full link
-
retrieveUpdatedPasswordPasswordLink
Description copied from interface:ISystemMailExtension
Retrieve the URL for updated password confirmation- Specified by:
retrieveUpdatedPasswordPasswordLink
in interfaceISystemMailExtension
- Parameters:
configuration
- the configuration- Returns:
- the full link
-
retrieveDefaultPlateformeLink
Description copied from interface:ISystemMailExtension
Retrieve the default login page URL- Specified by:
retrieveDefaultPlateformeLink
in interfaceISystemMailExtension
- Returns:
- the link
-