Package com.mailjet.client.easy
Class MJEasyEmail
java.lang.Object
com.mailjet.client.easy.MJEasyEmail
public class MJEasyEmail
extends java.lang.Object
Mailjet easy email sending object.
It's a MailjetRequest object wrapper
-
Constructor Summary
Constructors Modifier Constructor Description protectedMJEasyEmail(MJEasyClient client, MailjetRequest request) -
Method Summary
Modifier and Type Method Description MJEasyEmailcustomId(java.lang.String customId)Set the customIDMJEasyEmailfrom(java.lang.String email)Set the senderMJEasyEmailfrom(java.lang.String email, java.lang.String name)Set the senderMailjetRequestgetRequest()Get the internal MailjetRequest wrapped by the MJEasyEmail objectMJEasyEmailhtml(java.lang.String html)Set the HTML content of the messageMailjetResponsesend()Send the emailMJEasyEmailsubject(java.lang.String subject)Set the subjectMJEasyEmailtext(java.lang.String text)Set the text content of the messageMJEasyEmailto(java.lang.String email)Add a recipientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MJEasyEmail
-
-
Method Details
-
from
Set the sender- Parameters:
email- Email address of the sendername- Name of the sender- Returns:
- Current instance
-
from
Set the sender- Parameters:
email- Email address of the sender- Returns:
- Current instance
-
to
Add a recipient- Parameters:
email- Email of the recipient- Returns:
- Current instance
-
subject
Set the subject- Parameters:
subject- Subject of the email- Returns:
- Current instance
-
text
Set the text content of the message- Parameters:
text- Text content- Returns:
- Current instance
-
html
Set the HTML content of the message- Parameters:
html- HTML content- Returns:
- Current instance
-
customId
Set the customID- Parameters:
customId- CustomID- Returns:
- Current instance
-
send
Send the email- Returns:
- a MailjetResponse instance
- Throws:
MailjetException
-
getRequest
Get the internal MailjetRequest wrapped by the MJEasyEmail object- Returns:
- MailjetRequest instance
-