Class BBjAdminEmailAttachment

java.lang.Object
com.basis.api.admin.BBjAdminEmailAttachment
All Implemented Interfaces:
Serializable

public class BBjAdminEmailAttachment extends Object implements Serializable

A single email message that will be sent through a BBjAdminEmailService.

Find a complete code sample at: BBjAdminEmailService.

See Also:
  • Constructor Details

    • BBjAdminEmailAttachment

      public BBjAdminEmailAttachment()
  • Method Details

    • setFilename

      public void setFilename(String p_filename)
      Sets the filename for the attached file.
      Parameters:
      p_filename - Name of file. Not the full path, just the filename.
    • getFilename

      public String getFilename()
      Get the filename for the attachment.
      Returns:
      Name of the file.
    • getBytes

      public byte[] getBytes() throws BBjAdminException
      Get the byte[] contents of the file.
      Returns:
      File's byte contents.
      Throws:
      BBjAdminException
    • setBytes

      public void setBytes(byte[] p_bytes)
      Set the byte array contents for the file. Use setBytesFromFile() to automatically set this by specifying the specific file to be attached.
      Parameters:
      p_bytes - Contents of the file.
    • setMimeType

      public void setMimeType(String p_type)
      Set the mime type for the data. Use setBytesFromFile() to automatically set this by specifying the specific file to be attached.
      Parameters:
      p_type -
    • getMimeType

      public String getMimeType()
      The mime type for the data.
    • getAttachmentId

      public String getAttachmentId()
    • setAttachmentId

      public void setAttachmentId(String p_attachmentId)
      Set the attachment ID when embedding an image in an email message. This value can be anything you'd like but it should match the content ID and should be the same value used for the CID in your img tag in the HTML. For example, if your image file is named foo.png, your content ID and attachment ID could be foo.png and then in your HTML where you'd like to embed the image you would include:
      img
      Parameters:
      p_attachmentId -
    • getContentId

      public String getContentId()
    • setContentId

      public void setContentId(String p_contentId)
      Set the content ID when embedding an image in an email message. This value can be anything you'd like but it should match the Attachment ID and should be the same value used for the CID in your img tag in the HTML. For example, if your image file is named foo.png, your content ID and attachment ID could be foo.png and then in your HTML where you'd like to embed the image you would include:
      img
      Parameters:
      p_contentId -
    • setBytesFromFile

      public void setBytesFromFile(File p_file) throws BBjAdminException
      Helper method to set the byte array for the file by specifying the java.io.File instead of a byte array. This also automatically sets the mime type as well.
      Parameters:
      p_file - File to extract bytes from.
      Throws:
      BBjAdminException