🎉 initial commit
This commit is contained in:
commit
c93a06972b
27 changed files with 4189 additions and 0 deletions
98
Civi/Mailinglistsync/MailingListManager.php
Normal file
98
Civi/Mailinglistsync/MailingListManager.php
Normal file
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
namespace Civi\Mailinglistsync;
|
||||
|
||||
use CRM_Mailinglistsync_ExtensionUtil as E;
|
||||
|
||||
class MailingListManager {
|
||||
|
||||
/**
|
||||
* Is the mailing list enabled?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private bool $enabled;
|
||||
|
||||
/**
|
||||
* Is logging enabled?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private mixed $logging;
|
||||
|
||||
/**
|
||||
* Host of the mlmmj server
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private string $mlmmjHost;
|
||||
|
||||
/**
|
||||
* Token for the mlmmj server
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private string $mlmmjToken;
|
||||
|
||||
/**
|
||||
* Port of the mlmmj server
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private int $mlmmjPort;
|
||||
|
||||
/**
|
||||
* Host of the dovecot server
|
||||
*
|
||||
* @var string|mixed
|
||||
*/
|
||||
private string $dovecotHost;
|
||||
|
||||
/**
|
||||
* Token for the dovecot server
|
||||
*
|
||||
* @var string|mixed
|
||||
*/
|
||||
private string $dovecotToken;
|
||||
|
||||
/**
|
||||
* Port of the dovecot server
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private int $dovecotPort;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
function __construct() {
|
||||
// Load settings
|
||||
$settings = MailingListSettings::get();
|
||||
$this->enabled = $settings[E::SHORT_NAME . '_enable'] ?? FALSE;
|
||||
$this->logging = $settings[E::SHORT_NAME . '_logging'] ?? FALSE;
|
||||
$this->mlmmjHost = $settings[E::SHORT_NAME . '_mlmmj_host'] ??
|
||||
throw new \Exception('No mlmmj host set');
|
||||
$this->mlmmjToken = $settings[E::SHORT_NAME . '_mlmmj_token'] ??
|
||||
throw new \Exception('No mlmmj token set');
|
||||
$this->mlmmjPort = $settings[E::SHORT_NAME . '_mlmmj_port'] ?? 443;
|
||||
$this->dovecotHost = $settings[E::SHORT_NAME . '_dovecot_host'] ??
|
||||
throw new \Exception('No dovecot host set');
|
||||
$this->dovecotToken = $settings[E::SHORT_NAME . '_dovecot_token'] ??
|
||||
throw new \Exception('No dovecot token set');
|
||||
$this->dovecotPort = $settings[E::SHORT_NAME . '_dovecot_port'] ?? 443;
|
||||
}
|
||||
|
||||
function createEmailAddress(string $emailAddress) {} // TODO
|
||||
|
||||
function deleteEmailAddress(string $emailAddress) {} // TODO
|
||||
|
||||
function createMailingList(BaseMailingList $mailingList) {} // TODO
|
||||
|
||||
function deleteMailingList(BaseMailingList $mailingList) {} // TODO
|
||||
|
||||
function updateMailingList(BaseMailingList $mailingList) {} // TODO
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue