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 String
Name of theauthentication attribute
for the client ID.static final String
Name of theauthentication attribute
for the client secret.static final String
Deprecated.static final String
Name of theauthentication attribute
for the tenant IDFields inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
addressFilter, serverData
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.microsoft.graph.authentication.IAuthenticationProvider
protected String
buildMessage
(javax.mail.internet.MimeMessage msg, Mandant client) protected Properties
protected javax.mail.internet.MimeMessage
createMimeMessage
(IBaseMailData mail, Mandant client) protected com.microsoft.graph.models.User
searchUser
(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail) protected ISentMailData
send
(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, setAddressFilter
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.mail.interfaces.IMailContext
archive, getServerData, send, send, setAddressFilter, setAddressFilter
-
Field Details
-
ATTR_TENANT_ID
Name of theauthentication attribute
for the tenant ID- See Also:
-
ATTR_TANENT_ID
Deprecated.UseATTR_TENANT_ID
- See Also:
-
ATTR_CLIENT_SECRET
Name of theauthentication attribute
for the client secret.- See Also:
-
ATTR_CLIENT_ID
Name of theauthentication attribute
for the client ID.- See Also:
-
-
Method Details
-
sendWithReport
Description copied from interface:IMailContext
Sends a mail based on the given data- Specified by:
sendWithReport
in interfaceIMailContext
- Overrides:
sendWithReport
in 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:IMailContext
Sends a mail based on the given data- Specified by:
sendWithReport
in interfaceIMailContext
- Overrides:
sendWithReport
in 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.ClientException
javax.mail.MessagingException
-
buildProperties
- Overrides:
buildProperties
in classDefaultMailContext
-
createMimeMessage
protected javax.mail.internet.MimeMessage createMimeMessage(IBaseMailData mail, Mandant client) throws javax.mail.MessagingException - Overrides:
createMimeMessage
in 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