API Docs for:
Show:

models.server.Email Class

Methods

_parseRecipient

() Object

Returns:

Object:

createdAt

() Date

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:12

Returns:

Date:

deletedAt

() Date

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:36

Returns:

Date:

fetchOrCreate

(
  • identifier
)
Bluebird.Promise

Fetch or create a model uniquely identified by the columns defined in the identifier

Parameters:

  • identifier Object

    Object of table columns

Returns:

Bluebird.Promise:

with the model instance

fetchUser

() Bluebird.Promise

Returns:

Bluebird.Promise:

with model.server.User

getBody

() String

Returns:

String:

getEmailSecret

() String

Returns:

String:

getFiles

() Array

Returns:

Array:

Array of file objects for Comment#addExistingAttachment

getSenderEmail

() String

Returns:

String:

getSenderName

() String

Returns:

String:

getState

() String

Get state of the email

Returns:

String:

getSubject

() String

Returns:

String:

getTicketId

() Number

The ticket id for which this email is a response to

Returns:

Number:

hasVisibility

(
  • visibility
  • models
)

Visibility assertion helper

Parameters:

  • visibility String
  • models Array

    Array of models.server.Visibility models

Returns:

Boolean

isReply

()

Return true if this email is a reply to existing ticket

isSame

(
  • other
)

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:48

Return true if the other object is built using the same constructor and they have the same id

Parameters:

Returns:

Boolean

isSoftDeleted

() Boolean

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:28

Returns:

Boolean:

reject

() models.server.Email

Set email state as rejected

softDelete

(
  • byUser
)
Bluebird.Promise

Set timestamp to deletedAt

Parameters:

Returns:

submitAsNewTicket

() Bluebird.Promise

Create new ticket from this email

Returns:

Bluebird.Promise:

with the new models.server.Ticket

submitAsReply

(
  • ticket
)
Bluebird.Promise

Submit this ticket as reply to given ticket

Parameters:

Returns:

Bluebird.Promise:

with models.server.Comment

uniqueId

() String

Returns:

String:

updatedAt

() Date

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:20

Returns:

Date:

Properties

type

String

The database table name

Virtual database field. Use .get("type") to access it.

unique_id

String

Unique id between tables.

Virtual database field. Use .get("unique_id") to access it.

user

models.server.User

User object fetched within Email#fetchUser()