Package org.keycloak.email
Class DefaultEmailSenderProvider
java.lang.Object
org.keycloak.email.DefaultEmailSenderProvider
- All Implemented Interfaces:
EmailSenderProvider,Provider
- Author:
- Stian Thorgersen
-
Field Summary
Fields inherited from interface org.keycloak.email.EmailSenderProvider
CONFIG_ALLOW_UTF8 -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEmailSenderProvider(KeycloakSession session, Map<EmailAuthenticator.AuthenticatorType, EmailAuthenticator> authenticators) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected Stringvoidvoidprotected jakarta.mail.internet.InternetAddresstoInternetAddress(String email, String displayName) voidValidates configuration for the SMTP sender.
-
Constructor Details
-
DefaultEmailSenderProvider
public DefaultEmailSenderProvider(KeycloakSession session, Map<EmailAuthenticator.AuthenticatorType, EmailAuthenticator> authenticators)
-
-
Method Details
-
send
public void send(Map<String, String> config, UserModel user, String subject, String textBody, String htmlBody) throws EmailException- Specified by:
sendin interfaceEmailSenderProvider- Throws:
EmailException
-
send
public void send(Map<String, String> config, String address, String subject, String textBody, String htmlBody) throws EmailException- Specified by:
sendin interfaceEmailSenderProvider- Throws:
EmailException
-
validate
Description copied from interface:EmailSenderProviderValidates configuration for the SMTP sender.- Specified by:
validatein interfaceEmailSenderProvider- Parameters:
config- The configuration to test- Throws:
EmailException- If some error is found
-
toInternetAddress
protected jakarta.mail.internet.InternetAddress toInternetAddress(String email, String displayName) throws UnsupportedEncodingException, jakarta.mail.internet.AddressException, EmailException - Throws:
UnsupportedEncodingExceptionjakarta.mail.internet.AddressExceptionEmailException
-
retrieveEmailAddress
-
close
public void close()
-