Package de.xima.fc.handler.system
Class MailHandler
- java.lang.Object
-
- de.xima.fc.handler.AMSApiHandler
-
- de.xima.fc.handler.system.MailHandler
-
- All Implemented Interfaces:
IAPIHandler
,IMailHandler
,Serializable
public class MailHandler extends AMSApiHandler implements IMailHandler
The Class MailHandler.- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MailHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
sendClientMail(Mandant client, IBaseMailData mailData)
Sends an email as the given clientboolean
sendEmailVerificationMail(UserContext uc, UserEmail email, String baseUrl)
Sends a mail with a user email verification linkboolean
sendFeedbackMail(UserContext uc, Mandant client, IFeedbackMailData feedbackMailData)
Send a feedback mail from the given client.boolean
sendInviteMail(UserContext uc, Vorgang vorgang, String mailTo, DefaultReplacerParameters params)
boolean
sendLoginChanged(UserContext uc, Benutzer benuter, String passwort)
Deprecated.boolean
sendOptInMail(UserContext uc, Vorgang vorgang)
Send a feedback mail from the given client.boolean
sendPrimaryEmailChangeMail(UserContext uc, UserEmail email, String baseUrl)
Sends a mail with a link to change the primary email of the user profile to theUserEmail
given.boolean
sendResetPasswordMail(UserContext uc, Benutzer user, String url)
Deprecated.boolean
sendSupportMail(UserContext uc, Mandant client, ISupportInquiryData supportInquiryData)
Send a support mail from the given client.boolean
sendUserCredentialsResetMail(UserContext uc, UserProfile profile, String baseUrl, String verifiedTargetEmailAddress)
Sends a mail with a user credentials set/reset link.boolean
sendUserIdentityConnectedMail(UserContext uc, UserIdentity identity, String connectorEmail, Instant isntant, String remoteAddr, String userAgent, String baseUrl)
Sends a mail informing the user profile owner about the connection of a newaccount
with the option to remove the account.boolean
sendUserIdentityRemovalMail(UserContext uc, UserIdentity identity, String baseUrl)
Sends a mail with a link to remove the given user identity to the primaryUserEmail
of the identity's profile.boolean
sendUserMfaEmailCodeMail(IUser user, Locale defaultLocale)
Sends a mail with an MFA code.boolean
sendUserMfaRemovalMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)
Sends a mail with an MFA removal link to the users primary email address.boolean
sendUserMfaTotpRegistrationMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)
Deprecated.boolean
sendUserProfileDeleteRequestMail(UserContext uc, UserProfile userProfile, String baseUrl)
Sends a mail with a user profile delete request containing a link to delete the user profile.boolean
sendUserProfileMergeRequestMail(UserContext uc, UserProfile userProfile, UserProfile toBeMerged, String baseUrl)
Sends a mail with a user profile merge link.-
Methods inherited from class de.xima.fc.handler.AMSApiHandler
getName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.com.interfaces.IAPIHandler
getName
-
-
-
-
Method Detail
-
sendClientMail
public boolean sendClientMail(Mandant client, IBaseMailData mailData)
Sends an email as the given client- Specified by:
sendClientMail
in interfaceIMailHandler
- Parameters:
client
-Mandant
sending the emailmailData
-IBaseMailData
content of the mail- Returns:
Boolean
whether or not the email could be sent successfully
-
sendSupportMail
public boolean sendSupportMail(UserContext uc, Mandant client, ISupportInquiryData supportInquiryData)
Send a support mail from the given client. If no client is given tries using the system mail settings- Specified by:
sendSupportMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
the user context in which the action is to be performed.client
-Mandant
for which to send the mailsupportInquiryData
-SupportInquiryData
containing support inquiry information- Returns:
- Whether or not the email was sent successfully
-
sendFeedbackMail
public boolean sendFeedbackMail(UserContext uc, Mandant client, IFeedbackMailData feedbackMailData)
Description copied from interface:IMailHandler
Send a feedback mail from the given client. If no client is given, attempt to use the system mail settings.- Specified by:
sendFeedbackMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
the user context in which the action is to be performed.client
-Mandant
for which to send the mailfeedbackMailData
-IFeedbackMailData
containing feedback information- Returns:
- Whether or not the email was sent successfully
-
sendOptInMail
public boolean sendOptInMail(UserContext uc, Vorgang vorgang)
Description copied from interface:IMailHandler
Send a feedback mail from the given client. If no client is given, attempt to use the system mail settings.- Specified by:
sendOptInMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
the user context in which the action is to be performed.vorgang
-Vorgang
for which to send the mail- Returns:
- Whether or not the email was sent successfully
-
sendInviteMail
public boolean sendInviteMail(UserContext uc, Vorgang vorgang, String mailTo, DefaultReplacerParameters params)
- Specified by:
sendInviteMail
in interfaceIMailHandler
-
sendUserCredentialsResetMail
public boolean sendUserCredentialsResetMail(UserContext uc, UserProfile profile, String baseUrl, String verifiedTargetEmailAddress)
Description copied from interface:IMailHandler
Sends a mail with a user credentials set/reset link. The mail will be send to the users primary email address.- Specified by:
sendUserCredentialsResetMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.profile
- for which to send the credentials mail.baseUrl
- base URL to use when building the credentials mail.verifiedTargetEmailAddress
- email address that should receive the user credentials reset request. This email needs to exists in the given user profile and it needs to be verified. A user credentials reset mail cannot be send otherwise!- Returns:
- Whether or not an email was sent successfully.
-
sendEmailVerificationMail
public boolean sendEmailVerificationMail(UserContext uc, UserEmail email, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail with a user email verification link- Specified by:
sendEmailVerificationMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.email
- Email to send the verification request to.baseUrl
- base URL to use when building the verification URL- Returns:
- Whether or not an email was sent successfully.
-
sendPrimaryEmailChangeMail
public boolean sendPrimaryEmailChangeMail(UserContext uc, UserEmail email, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail with a link to change the primary email of the user profile to theUserEmail
given.- Specified by:
sendPrimaryEmailChangeMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.email
- Email to send the verification request to and change to primary mail.baseUrl
- base URL to use when building the verification URL- Returns:
- Whether or not an email was sent successfully.
-
sendUserIdentityConnectedMail
public boolean sendUserIdentityConnectedMail(UserContext uc, UserIdentity identity, String connectorEmail, Instant isntant, String remoteAddr, String userAgent, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail informing the user profile owner about the connection of a newaccount
with the option to remove the account.- Specified by:
sendUserIdentityConnectedMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.identity
- that has been connected to the user profileconnectorEmail
- that was used to connect the identity with the user profileisntant
- when the connection was maderemoteAddr
- of the client that triggered the connectionuserAgent
- of the client that triggered the connectionbaseUrl
- base URL to use when building URLs- Returns:
- Whether or not an email was sent successfully.
-
sendUserIdentityRemovalMail
public boolean sendUserIdentityRemovalMail(UserContext uc, UserIdentity identity, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail with a link to remove the given user identity to the primaryUserEmail
of the identity's profile.- Specified by:
sendUserIdentityRemovalMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.identity
- Identity to send the removal request for.baseUrl
- base URL to use when building the verification URL- Returns:
- Whether or not an email was sent successfully.
-
sendUserProfileMergeRequestMail
public boolean sendUserProfileMergeRequestMail(UserContext uc, UserProfile userProfile, UserProfile toBeMerged, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail with a user profile merge link.- Specified by:
sendUserProfileMergeRequestMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.userProfile
- user profile that will receive the merge request via email.toBeMerged
- user profile that should be merged into the profile that will receive the merge request.baseUrl
- base URL to use when building the merge URL.- Returns:
- Whether or not an email was sent successfully.
-
sendUserProfileDeleteRequestMail
public boolean sendUserProfileDeleteRequestMail(UserContext uc, UserProfile userProfile, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail with a user profile delete request containing a link to delete the user profile.- Specified by:
sendUserProfileDeleteRequestMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.userProfile
- to be deleted.baseUrl
- base URL to use when building the delete URL.- Returns:
true
if the mail has been send successfully andfalse
otherwise.
-
sendUserMfaTotpRegistrationMail
@Deprecated public boolean sendUserMfaTotpRegistrationMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)
Deprecated.Description copied from interface:IMailHandler
Sends a mail with an MFA TOTP registration link to the users primary email address.- Specified by:
sendUserMfaTotpRegistrationMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.mfaConfig
- to send MFA registration mail for.baseUrl
- base URL to use when building the registration URL- Returns:
- Whether or not an email was sent successfully.
-
sendUserMfaRemovalMail
public boolean sendUserMfaRemovalMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)
Description copied from interface:IMailHandler
Sends a mail with an MFA removal link to the users primary email address. Is intended for users to confirm the removal of the MFA from their account.- Specified by:
sendUserMfaRemovalMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
to use.mfaConfig
- to send MFA removal mail for.baseUrl
- base URL to use when building the removal URL- Returns:
- Whether or not an email was sent successfully.
-
sendUserMfaEmailCodeMail
public boolean sendUserMfaEmailCodeMail(IUser user, Locale defaultLocale)
Description copied from interface:IMailHandler
Sends a mail with an MFA code. This is for MFAs of typeEMultiFactorAuthenticationType.EMAIL
.- Specified by:
sendUserMfaEmailCodeMail
in interfaceIMailHandler
- Parameters:
user
- to send email with authentication code to.defaultLocale
- locale to use for localization of the email message if the user does not have a default locale.- Returns:
- Whether or not an email was sent successfully.
-
sendLoginChanged
@Deprecated public boolean sendLoginChanged(UserContext uc, Benutzer benuter, String passwort)
Deprecated.Description copied from interface:IMailHandler
Send login changed.- Specified by:
sendLoginChanged
in interfaceIMailHandler
benuter
- User whose login should be changed.passwort
- The new password.- Returns:
- Whether the login could be changes successfully.
-
sendResetPasswordMail
@Deprecated public boolean sendResetPasswordMail(UserContext uc, Benutzer user, String url)
Deprecated.Description copied from interface:IMailHandler
Sends an email to theBenutzer
for resetting their password- Specified by:
sendResetPasswordMail
in interfaceIMailHandler
- Parameters:
uc
-UserContext
in which the operation should be performeduser
-Benutzer
which should receive the emailurl
-String
url for resetting the password- Returns:
Boolean
whether the operation was successful or not
-
-