event invitation change

This commit is contained in:
yuri
2017-11-06 15:45:44 +02:00
parent 8ad80c7a1a
commit b37f60053d
@@ -110,15 +110,18 @@ class Meeting extends \Espo\Services\Record
return true;
}
protected function getInvitationManager()
protected function getInvitationManager($useUserSmtp = true)
{
$smtpParams = $this->getPreferences()->getSmtpParams();
if ($smtpParams) {
if (array_key_exists('password', $smtpParams)) {
$smtpParams['password'] = $this->getCrypt()->decrypt($smtpParams['password']);
$smtpParams = null;
if ($useUserSmtp) {
$smtpParams = $this->getPreferences()->getSmtpParams();
if ($smtpParams) {
if (array_key_exists('password', $smtpParams)) {
$smtpParams['password'] = $this->getCrypt()->decrypt($smtpParams['password']);
}
$smtpParams['fromAddress'] = $this->getUser()->get('emailAddress');
$smtpParams['fromName'] = $this->getUser()->get('name');
}
$smtpParams['fromAddress'] = $this->getUser()->get('emailAddress');
$smtpParams['fromName'] = $this->getUser()->get('name');
}
return new Invitations(
$this->getEntityManager(),
@@ -132,9 +135,9 @@ class Meeting extends \Espo\Services\Record
);
}
public function sendInvitations(Entity $entity)
public function sendInvitations(Entity $entity, $useUserSmtp = true)
{
$invitationManager = $this->getInvitationManager();
$invitationManager = $this->getInvitationManager($useUserSmtp);
$emailHash = array();