Package com.basis.api.admin
Class BBjAdminEmailAttachment
java.lang.Object
com.basis.api.admin.BBjAdminEmailAttachment
- All Implemented Interfaces:
Serializable
A single email message that will be sent through a BBjAdminEmailService.
Find a complete code sample at: BBjAdminEmailService
.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
Get the byte[] contents of the file.Get the filename for the attachment.The mime type for the data.void
setAttachmentId
(String p_attachmentId) Set the attachment ID when embedding an image in an email message.void
setBytes
(byte[] p_bytes) Set the byte array contents for the file.void
setBytesFromFile
(File p_file) Helper method to set the byte array for the file by specifying the java.io.File instead of a byte array.void
setContentId
(String p_contentId) Set the content ID when embedding an image in an email message.void
setFilename
(String p_filename) Sets the filename for the attached file.void
setMimeType
(String p_type) Set the mime type for the data.
-
Constructor Details
-
BBjAdminEmailAttachment
public BBjAdminEmailAttachment()
-
-
Method Details
-
setFilename
Sets the filename for the attached file.- Parameters:
p_filename
- Name of file. Not the full path, just the filename.
-
getFilename
Get the filename for the attachment.- Returns:
- Name of the file.
-
getBytes
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
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
The mime type for the data. -
getAttachmentId
-
setAttachmentId
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:
- Parameters:
p_attachmentId
-
-
getContentId
-
setContentId
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:
- Parameters:
p_contentId
-
-
setBytesFromFile
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
-