Package de.xima.fc.mail.impl.context
Class MSGraphMailContext
java.lang.Object
de.xima.fc.mail.impl.context.DefaultMailContext
de.xima.fc.mail.impl.context.MSGraphMailContext
- All Implemented Interfaces:
IMailContext
Mail context for sending MIME mails via the ms graph api
- Author:
- XIMA MEDIA GmbH
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of theauthentication attributefor the client ID.static final StringName of theauthentication attributefor the client secret.static final StringDeprecated.static final StringName of theauthentication attributefor the tenant IDFields inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
addressFilter, serverData -
Method Summary
Modifier and TypeMethodDescriptionprotected com.microsoft.graph.authentication.IAuthenticationProviderprotected StringbuildMessage(javax.mail.internet.MimeMessage msg, Mandant client) protected Propertiesprotected javax.mail.internet.MimeMessagecreateMimeMessage(IBaseMailData mail, Mandant client) protected com.microsoft.graph.models.UsersearchUser(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail) protected ISentMailDatasend(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail, Mandant client) sendWithReport(IBaseMailData mail) Sends a mail based on the given datasendWithReport(IBaseMailData mailData, Mandant client) Sends a mail based on the given dataMethods inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
archive, buildAndSendMessage, buildAuthenticator, buildBodyPart, buildContent, buildFilePart, createMimeMessage, enforceSenderAddress, filterAddresses, getServerData, setAddressFilterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.mail.interfaces.IMailContext
archive, getServerData, send, send, setAddressFilter, setAddressFilter
-
Field Details
-
ATTR_TENANT_ID
Name of theauthentication attributefor the tenant ID- See Also:
-
ATTR_TANENT_ID
Deprecated.UseATTR_TENANT_ID- See Also:
-
ATTR_CLIENT_SECRET
Name of theauthentication attributefor the client secret.- See Also:
-
ATTR_CLIENT_ID
Name of theauthentication attributefor the client ID.- See Also:
-
-
Method Details
-
sendWithReport
Description copied from interface:IMailContextSends a mail based on the given data- Specified by:
sendWithReportin interfaceIMailContext- Overrides:
sendWithReportin classDefaultMailContext- Parameters:
mail- Data with the mail or mails to sent.- Returns:
- Information about the mails that were actually sent.
- Throws:
Exception- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
sendWithReport
Description copied from interface:IMailContextSends a mail based on the given data- Specified by:
sendWithReportin interfaceIMailContext- Overrides:
sendWithReportin classDefaultMailContext- Parameters:
mailData- Data with the mail or mails to sent.client- The client scope to use for placeholder replacements- Returns:
- Information about the mails that were actually sent.
- Throws:
Exception- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
buildMessage
protected String buildMessage(javax.mail.internet.MimeMessage msg, Mandant client) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
send
protected ISentMailData send(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail, Mandant client) throws com.microsoft.graph.core.ClientException, javax.mail.MessagingException - Throws:
com.microsoft.graph.core.ClientExceptionjavax.mail.MessagingException
-
buildProperties
- Overrides:
buildPropertiesin classDefaultMailContext
-
createMimeMessage
protected javax.mail.internet.MimeMessage createMimeMessage(IBaseMailData mail, Mandant client) throws javax.mail.MessagingException - Overrides:
createMimeMessagein classDefaultMailContext- Throws:
javax.mail.MessagingException
-
buildAuthenticationProvider
protected com.microsoft.graph.authentication.IAuthenticationProvider buildAuthenticationProvider() -
searchUser
protected com.microsoft.graph.models.User searchUser(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail)
-
ATTR_TENANT_ID