EmailRecord

public class EmailRecord

The EmailRecord class represents a record of a sent Email. This class is exposed as an org.motechproject.mds.annotations.Entity through Motech Data Services.

See also: org.motechproject.mds.annotations

Constructors

EmailRecord

public EmailRecord()

Creates a new instance of EmailRecord, with all fields set to null.

EmailRecord

public EmailRecord(String fromAddress, String toAddress, String subject, String message, DateTime deliveryTime, DeliveryStatus deliveryStatus)

Creates a new instance of EmailRecord, with all fields set to the values specified in the parameters.

Parameters:
  • fromAddress – the email address of the sender
  • toAddress – the email address of the recipient
  • subject – the subject of the email
  • message – the body of the email
  • deliveryTime – the date and time that the email was sent
  • deliveryStatus – the delivery status of the email

Methods

equals

public boolean equals(Object obj)

Indicates whether some other object is “equal to” this one. Returns true if this EmailRecord and the object to compare have reference equality or their field values are all equal.

Parameters:
  • obj – The reference object with which to compare.
Returns:

true if this object is the same as the obj argument; false otherwise.

getDeliveryStatus

public DeliveryStatus getDeliveryStatus()

Gets the delivery status.

Returns:the delivery status of the message

getDeliveryTime

public DateTime getDeliveryTime()

Gets the delivery time.

Returns:the time that the email was sent

getFromAddress

public String getFromAddress()

Gets the email address of the sender.

Returns:the sender of the message

getId

public Long getId()

getMessage

public String getMessage()

Gets the message body.

Returns:the body of the message

getSubject

public String getSubject()

Gets the message subject.

Returns:the subject of the message

getToAddress

public String getToAddress()

Gets the email address of the recipient.

Returns:the recipient of the message

hashCode

public int hashCode()

Returns a hash code value for this EmailRecord object.

Returns:a hash code value for this EmailRecord object

setFromAddress

public void setFromAddress(String fromAddress)

Sets the email address of the sender.

Parameters:
  • fromAddress – the sender of the message

setId

public void setId(Long id)

setMessage

public void setMessage(String message)

Sets the message body.

Parameters:
  • message – the body of the message

setSubject

public void setSubject(String subject)

Sets the message subject.

Parameters:
  • subject – the subject of the message

setToAddress

public void setToAddress(String toAddress)

Sets the email address of the recipient.

Parameters:
  • toAddress – the recipient of the message

toString

public String toString()

Returns a string representation of this EmailRecord object.

Returns:a string representation of this EmailRecord object