Author |
|
ThomasH Newbie
Joined: 29 January 2018 Location: Germany
Online Status: Offline Posts: 7
|
Posted: 29 November 2018 at 11:57pm | IP Logged
|
|
|
Hi,
I am using the "Logging in programmatically" feature to login users and setting the signature for them. With version 7 i have used these to set signature:
$oApiIntegratorManager = CApi::Manager('integrator');
$oAccount = $oApiIntegratorManager->loginToAccount($sEmail, $sPassword);
$oApiIntegratorManager->setAccountAsLoggedIn($oAccount);
$oApiUsersManager = CApi::Manager('users');
$oAccount->Signature = "signature here"
$oAccount->SignatureOptions = EAccountSignatureOptions::AddToAll;
$oAccount->SignatureType = EAccountSignatureType::Plain;
$oApiUsersManager->UpdateAccount($oAccount);
CApi::Location('http://url_of_webmail/');
Since Aurora and version 8 I did not find a API which allows me to set the signature.
How can this be done in Version 8?
best regards
Thomas
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 30 November 2018 at 1:14am | IP Logged
|
|
|
Assuming the account already exists, something like this would work:
Code:
<?php
include_once './system/autoload.php';
\Aurora\System\Api::Init(true);
$oMailModule = \Aurora\System\Api::GetModule("Mail");
$sEmail = 'user@domain.com';
$mAcc = $oMailModule->oApiAccountsManager->getAccountUsedToAuthorize($sEmail);
$mAcc->Signature = '<div data-crea="font-wrapper" style="font-family: ; font-size: ; direction: ">Signature goes here,<br>and here too.</div>';
$oMailModule->oApiAccountsManager->updateAccount($mAcc); |
|
|
--
Regards,
Igor, Afterlogic Support
|
Back to Top |
|
|
ThomasH Newbie
Joined: 29 January 2018 Location: Germany
Online Status: Offline Posts: 7
|
Posted: 06 December 2018 at 3:01am | IP Logged
|
|
|
Dear Igor,
thank you this worked.
just added:
$mAcc->UseSignature = true;
to enable the signature.
|
Back to Top |
|
|