Community
Showing results for 
Search instead for 
Do you mean 
Reply

Opening EMail client from SDK

Copper Contributor
Posts: 150
Country: Belgium

Opening EMail client from SDK

Hello,

 

I'm trying to find a proper way of opening the Sage Act EMail client using the SDK and automatically filling in the "To" field.

 

Basically I've found it's possible just opening the executeable and passing the email address as a parameter. But using that method it appears that the Email client ignores some of the client's settings (like it defaults to plain text mail instead of html).

 

From what I can see you can access the UIEmailManager from an actapplication reference, but that only seems to have methods to send mail, which instantly sends message.

 

There is the ActApp.UIEmailManager.WriteMail() method, but it doesn't look like I can parse the address of the recipient using that method.

 

Any ideas/help on this?

Copper Contributor
Posts: 150
Country: Belgium

Re: Opening EMail client from SDK

Got the first part, was something stupid I overlooked.

 

Now I'm pretty much stumped as to how to get the user's signature in the mail.

 

Code I've got right now is:

ActApp.UIEmailManager.CreateEmailDraft(SC, "Signature goes here", DateTime.Now.ToString("yyyyMMdd") & "-", Act.Framework.Preferences.Enums.EmailCreateHistoryType.AttachContact, False, False, Nothing)

 

I'm guessing since the user's signature is a preferrence, you're suposed to get it somehow through:

ActApp.ActFramework.Preferences.UserPreferences.GetStringValue("Signature setting name goes here?")

 

Am I on the right track? Or is there another better way to get the signature.

Copper Contributor
Posts: 150
Country: Belgium

Re: Opening EMail client from SDK

Ok, I was being stupid, tested by putting "Test" as a parameter in the method, which just puts "Test" in the body, while leaving it empty fills in the signature nicely.

 

Now my next pickle. I see a Actapp.UIEmailManager.MailSent, Can I catch the event of a mail being sent (even if it's to a secondary contact), and then attach that email to the primary contact?