1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-24 19:33:07 +01:00
freescout/app/Mailbox.php

84 lines
2.1 KiB
PHP
Raw Normal View History

2018-06-26 11:43:11 +02:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Hash;
class Mailbox extends Model
{
/**
* From Name: name that will appear in the From field when a customer views your email.
*/
const FROM_NAME_MAILBOX = 1;
const FROM_NAME_USER = 2;
const FROM_NAME_CUSTOM = 3;
/**
* Default Status: when you reply to a message, this status will be set by default (also applies to email integration).
*/
const TICKET_STATUS_ACTIVE = 1;
const TICKET_STATUS_PENDING = 2;
const TICKET_STATUS_CLOSED = 3;
/**
* Default Assignee
*/
const TICKET_ASSIGNEE_ANYONE = 1;
const TICKET_ASSIGNEE_REPLYING_UNASSIGNED = 2;
const TICKET_ASSIGNEE_REPLYING = 3;
/**
* Email Template
*/
const TEMPLATE_FANCY = 1;
const TEMPLATE_PLAIN = 2;
/**
* Sending Emails
*/
const OUT_METHOD_PHP_MAIL = 1;
const OUT_METHOD_SENDMAIL = 2;
const OUT_METHOD_SMTP = 3;
const OUT_METHOD_GMAIL = 3;
// todo: mailgun, sendgrid, mandrill, etc
/**
* Secure Connection
*/
const OUT_SSL_NONE = 1;
const OUT_SSL_SSL = 2;
const OUT_SSL_TLS = 3;
/**
* Ratings Playcement: place ratings text above/below signature.
*/
const RATINGS_PLACEMENT_ABOVE = 1;
const RATINGS_PLACEMENT_BELOW = 2;
/**
* Attributes fillable using fill() method
* @var [type]
*/
protected $fillable = ['name', 'slug', 'email', 'aliases', 'from_name', 'from_name_custom', 'ticket_status', 'ticket_assignee', 'template', 'signature', 'out_method', 'out_server', 'out_username', 'out_port', 'out_ssl', 'auto_reply_enabled', 'auto_reply_subject', 'auto_reply_message', 'office_hours_enabled', 'ratings', 'ratings_placement', 'ratings_text'];
protected static function boot()
{
parent::boot();
self::created(function (Mailbox $model)
{
$model->slug = strtolower(substr(md5(Hash::make($model->id)), 0, 16));
});
}
2018-06-29 07:07:00 +02:00
/**
* Get users having access to the mailbox
*/
public function users()
{
return $this->belongsToMany('App\User');
}
2018-06-26 11:43:11 +02:00
}