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
public class MSGraphMailContext extends DefaultMailContext implements IMailContext
Mail context for sending MIME mails via the ms graph api- Author:
- XIMA MEDIA GmbH, Dresden
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_CLIENT_ID
static String
ATTR_CLIENT_SECRET
static String
ATTR_TANENT_ID
-
Fields inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
addressFilter, serverData
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.microsoft.graph.authentication.IAuthenticationProvider
buildAuthenticationProvider()
protected String
buildMessage(javax.mail.internet.MimeMessage msg)
protected com.microsoft.graph.models.User
searchUser(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail)
protected void
send(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail)
void
send(IBaseMailData mail)
Sends an mail based on the given datavoid
send(IBaseMailData mailData, Mandant client)
Sends an mail based on the given data-
Methods inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
buildAndSendMessage, buildAuthenticator, buildBodyPart, buildContent, buildFilePart, buildProperties, createMimeMessage, 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
getServerData, setAddressFilter, setAddressFilter
-
-
-
-
Field Detail
-
ATTR_TANENT_ID
public static final String ATTR_TANENT_ID
- See Also:
- Constant Field Values
-
ATTR_CLIENT_SECRET
public static final String ATTR_CLIENT_SECRET
- See Also:
- Constant Field Values
-
ATTR_CLIENT_ID
public static final String ATTR_CLIENT_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
send
public void send(IBaseMailData mail) throws Exception
Description copied from interface:IMailContext
Sends an mail based on the given data- Specified by:
send
in interfaceIMailContext
- Overrides:
send
in classDefaultMailContext
- Parameters:
mail
- the mail data- Throws:
Exception
- on errors while sending the mail
-
send
public void send(IBaseMailData mailData, Mandant client) throws Exception
Description copied from interface:IMailContext
Sends an mail based on the given data- Specified by:
send
in interfaceIMailContext
- Overrides:
send
in classDefaultMailContext
- Parameters:
mailData
- Data of the email to send.client
- the client to use for placeholder replacements- Throws:
Exception
- on errors while sending the mail
-
buildMessage
protected String buildMessage(javax.mail.internet.MimeMessage msg) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
send
protected void send(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail) throws com.microsoft.graph.core.ClientException, javax.mail.MessagingException
- Throws:
com.microsoft.graph.core.ClientException
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)
-
-