Package de.xima.fc.api.system
Class MailAPI
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.system.MailAPI
-
public class MailAPI extends ASubAPI
API class for sending of system mails.- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description MailAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleansendClientMail(Mandant client, IBaseMailData mailData)Sends an email as the given clientbooleansendEmailVerificationMail(UserContext uc, UserEmail email, String baseUrl)Sends a mail with a user email verification linkbooleansendFeedbackMail(UserContext uc, Mandant client, IFeedbackMailData feedbackMailData)Send a feedback mail from the given client.booleansendInviteMail(UserContext uc, Vorgang vorgang, String mailTo, DefaultReplacerParameters params)booleansendLoginChangedMail(UserContext uc, Benutzer user, String password)Deprecated.booleansendOptInMail(UserContext uc, Vorgang vorgang)Sends an email as the given clientbooleansendPrimaryEmailChangeMail(UserContext uc, UserEmail email, String baseUrl)Sends a mail with a link to change the primary email of the user profile to theUserEmailgiven.booleansendResetPasswordMail(UserContext uc, Benutzer user, String url)Deprecated.booleansendSupportMail(UserContext uc, Mandant client, ISupportInquiryData supportInquiryData)Send a support mail from the given client.booleansendUserCredentialsResetMail(UserContext uc, UserProfile profile, String baseUrl)Sends a mail with a user credentials set/reset link.booleansendUserCredentialsResetMail(UserContext uc, UserProfile profile, String baseUrl, String verifiedTargetEmailAddress)Sends a mail with a user credentials set/reset link.booleansendUserIdentityConnectedMail(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 newaccountwith the option to remove the account.booleansendUserIdentityRemovalMail(UserContext uc, UserIdentity identity, String baseUrl)Sends a mail with a link to remove the given user identity to the primaryUserEmailof the identity's profile.booleansendUserMfaEmailCodeMail(IUser user, Locale defaultLocale)Sends a mail with an MFA code.booleansendUserMfaRemovalMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)Sends a mail with an MFA removal link to the users primary email address.booleansendUserMfaTotpRegistrationMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)Sends a mail with an MFA TOTP registration link to the users primary email address.booleansendUserProfileDeleteRequestMail(UserContext uc, UserProfile userProfile, String baseUrl)Sends a mail with a user profile delete request containing a link to delete the user profile.booleansendUserProfileMergeRequestMail(UserContext uc, UserProfile userProfile, UserProfile toBeMerged, String baseUrl)Sends a mail with a user profile merge link.-
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
-
-
-
Method Detail
-
sendClientMail
public boolean sendClientMail(Mandant client, IBaseMailData mailData)
Sends an email as the given client- Parameters:
client-Mandantsending the emailmailData-IBaseMailDatacontent of the mail- Returns:
Booleanwhether or not the email could be sent successfully- Since:
- 6.0.0
-
sendOptInMail
public boolean sendOptInMail(UserContext uc, Vorgang vorgang)
Sends an email as the given client- Parameters:
uc-UserContextthe user context in which the action is to be performed.vorgang-Vorgangsending the email- Returns:
Booleanwhether or not the email could be sent successfully- Since:
- 6.0.0
-
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- Parameters:
uc-UserContextthe user context in which the action is to be performed.client-Mandantfor which to send the mailsupportInquiryData-SupportInquiryDatacontaining support inquiry information- Returns:
- Whether or not the email was sent successfully
- Since:
- 6.0.0
-
sendFeedbackMail
public boolean sendFeedbackMail(UserContext uc, Mandant client, IFeedbackMailData feedbackMailData)
Send a feedback mail from the given client. If no client is attempt to use the system mail settings- Parameters:
uc-UserContextthe user context in which the action is to be performed.client-Mandantfor which to send the mailfeedbackMailData-SupportInquiryDatacontaining feedback information- Returns:
- Whether or not the email was sent successfully
- Since:
- 6.0.0
-
sendInviteMail
public boolean sendInviteMail(UserContext uc, Vorgang vorgang, String mailTo, DefaultReplacerParameters params)
-
sendUserCredentialsResetMail
public boolean sendUserCredentialsResetMail(UserContext uc, UserProfile profile, String baseUrl)
Sends a mail with a user credentials set/reset link. The mail will be send to the users primary email address.- Parameters:
uc-UserContextto use.profile- for which to send the credentials mail.baseUrl- base URL to use when building the credentials mail.- Returns:
- Whether or not an email was sent successfully.
- Since:
- 8.0.0
-
sendUserCredentialsResetMail
public boolean sendUserCredentialsResetMail(UserContext uc, UserProfile profile, String baseUrl, String verifiedTargetEmailAddress)
Sends a mail with a user credentials set/reset link. The mail will be send to the users primary email address.- Parameters:
uc-UserContextto 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.
- Since:
- 8.0.0
-
sendEmailVerificationMail
public boolean sendEmailVerificationMail(UserContext uc, UserEmail email, String baseUrl)
Sends a mail with a user email verification link- Parameters:
uc-UserContextto use.email- Email to send the verification request to.baseUrl- base URL to use when building the verification URL- Returns:
- Whether or no an email was sent successfully.
- Since:
- 8.0.0
-
sendPrimaryEmailChangeMail
public boolean sendPrimaryEmailChangeMail(UserContext uc, UserEmail email, String baseUrl)
Sends a mail with a link to change the primary email of the user profile to theUserEmailgiven.- Parameters:
uc-UserContextto 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 no an email was sent successfully.
- Since:
- 8.0.0
-
sendUserIdentityConnectedMail
public 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 newaccountwith the option to remove the account.- Parameters:
uc-UserContextto 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.
- Since:
- 8.0.0
-
sendUserIdentityRemovalMail
public boolean sendUserIdentityRemovalMail(UserContext uc, UserIdentity identity, String baseUrl)
Sends a mail with a link to remove the given user identity to the primaryUserEmailof the identity's profile.- Parameters:
uc-UserContextto 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.
- Since:
- 8.0.0
-
sendUserProfileMergeRequestMail
public boolean sendUserProfileMergeRequestMail(UserContext uc, UserProfile userProfile, UserProfile toBeMerged, String baseUrl)
Sends a mail with a user profile merge link.- Parameters:
uc-UserContextto 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.- Returns:
- Whether or no an email was sent successfully.
- Since:
- 8.0.0
-
sendUserProfileDeleteRequestMail
public 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.- Parameters:
uc-UserContextto use.userProfile- to be deleted.baseUrl- base URL to use when building the delete URL.- Returns:
trueif the mail has been send successfully andfalseotherwise.- Since:
- 8.0.0
-
sendUserMfaTotpRegistrationMail
public boolean sendUserMfaTotpRegistrationMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)
Sends a mail with an MFA TOTP registration link to the users primary email address.- Parameters:
uc-UserContextto 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.
- Since:
- 8.0.0
-
sendUserMfaRemovalMail
public boolean sendUserMfaRemovalMail(UserContext uc, UserProfileMfa mfaConfig, String baseUrl)
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.- Parameters:
uc-UserContextto 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.
- Since:
- 8.0.0
-
sendUserMfaEmailCodeMail
public boolean sendUserMfaEmailCodeMail(IUser user, Locale defaultLocale)
Sends a mail with an MFA code. This is for MFAs of typeEMultiFactorAuthenticationType.EMAIL.- 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.
- Since:
- 8.0.0
-
sendLoginChangedMail
@Deprecated public boolean sendLoginChangedMail(UserContext uc, Benutzer user, String password)
Deprecated.Method for sending a mail with changed login data.- Parameters:
uc-UserContextthe user context in which the action is to be performed.user-Benutzerto which the mail should be sent.password-Stringthe new password ofBenutzers.- Returns:
Booleanwhether the action was successful or not.- Since:
- 2.4.3
-
sendResetPasswordMail
@Deprecated public boolean sendResetPasswordMail(UserContext uc, Benutzer user, String url)
Deprecated.Sends an email to theBenutzerfor resetting their password.- Parameters:
uc-UserContextin which the operation should be performed.user-Benutzerwhich should receive the email.url-StringURL for resetting the password.- Returns:
Booleanwhether the operation was successful or not.
-
-