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
    protected MJEasyEmail​(MJEasyClient client, MailjetRequest request)  
  • Method Summary

    Modifier and Type Method Description
    MJEasyEmail customId​(java.lang.String customId)
    Set the customID
    MJEasyEmail from​(java.lang.String email)
    Set the sender
    MJEasyEmail from​(java.lang.String email, java.lang.String name)
    Set the sender
    MailjetRequest getRequest()
    Get the internal MailjetRequest wrapped by the MJEasyEmail object
    MJEasyEmail html​(java.lang.String html)
    Set the HTML content of the message
    MailjetResponse send()
    Send the email
    MJEasyEmail subject​(java.lang.String subject)
    Set the subject
    MJEasyEmail text​(java.lang.String text)
    Set the text content of the message
    MJEasyEmail to​(java.lang.String email)
    Add a recipient

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • from

      public MJEasyEmail from​(java.lang.String email, java.lang.String name)
      Set the sender
      Parameters:
      email - Email address of the sender
      name - Name of the sender
      Returns:
      Current instance
    • from

      public MJEasyEmail from​(java.lang.String email)
      Set the sender
      Parameters:
      email - Email address of the sender
      Returns:
      Current instance
    • to

      public MJEasyEmail to​(java.lang.String email)
      Add a recipient
      Parameters:
      email - Email of the recipient
      Returns:
      Current instance
    • subject

      public MJEasyEmail subject​(java.lang.String subject)
      Set the subject
      Parameters:
      subject - Subject of the email
      Returns:
      Current instance
    • text

      public MJEasyEmail text​(java.lang.String text)
      Set the text content of the message
      Parameters:
      text - Text content
      Returns:
      Current instance
    • html

      public MJEasyEmail html​(java.lang.String html)
      Set the HTML content of the message
      Parameters:
      html - HTML content
      Returns:
      Current instance
    • customId

      public MJEasyEmail customId​(java.lang.String customId)
      Set the customID
      Parameters:
      customId - CustomID
      Returns:
      Current instance
    • send

      public MailjetResponse send() throws MailjetException
      Send the email
      Returns:
      a MailjetResponse instance
      Throws:
      MailjetException
    • getRequest

      public MailjetRequest getRequest()
      Get the internal MailjetRequest wrapped by the MJEasyEmail object
      Returns:
      MailjetRequest instance