Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite

 AfterLogic Forum : AfterLogic WebMail Lite
Subject Topic: setting signature Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ThomasH
Newbie
Newbie


Joined: 29 January 2018
Location: Germany
Online Status: Offline
Posts: 7
Posted: 29 November 2018 at 11:57pm | IP Logged Quote ThomasH

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 View ThomasH's Profile Search for other posts by ThomasH
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 30 November 2018 at 1:14am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
ThomasH
Newbie
Newbie


Joined: 29 January 2018
Location: Germany
Online Status: Offline
Posts: 7
Posted: 06 December 2018 at 3:01am | IP Logged Quote ThomasH

Dear Igor,

thank you this worked.
just added:
$mAcc->UseSignature = true;
to enable the signature.
Back to Top View ThomasH's Profile Search for other posts by ThomasH
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide