Solved

Open up an Outlook mail with attachments and eSignature in Aurena

  • 20 October 2022
  • 4 replies
  • 219 views

Badge +3

Hi,

We created a command button called “Email Quotation” in the Sales Quotation window. Once the user presses the command button, the system will open up the new outlook mail attached with the relevant sales quotation report pdf. At the moment this is working fine (used “agentcall DownloadAndSend”) but the customer needs to get the e-signature into the new outlook mail. 

Is it possible to open up new outlook mail with a loaded e-signature in Aurena? 

Please see the below screenshots of how this works in the Aurena application right now.

 

 

Also, I checked the formatted text in outlook mail. It's “Aa plain Text”

 

icon

Best answer by Mathias Dahl 25 October 2022, 21:06

View original

4 replies

Userlevel 7
Badge +30

Can you elaborate more on the e-signature? What is it, in this case (I know what it is in some contexts)? How do you create it? Where is it? Etc.

Badge +3

Hi @Mathias Dahl ,

Thanks for the reply. As an example, if I try to create a new email using Outlook it will load the mail with the default signature.

but when we open up the new mail using Aurena, it’s not getting the signature like above. it’s shown below.

 

Is there any possibility to get a signature using AurenaAgent?

Thanks & BR,

Isuru

Userlevel 7
Badge +30

Hi,

Okay, I understand now. I think that should be possible by using a document macro that will send the e-mail. It still needs the Aurena Agent to work, but it will replace the default e-mail functionality.

Below you will find a working document macro that can be used to send an e-mail. Please note that it does not add any signature. That part you need to find out yourself (search for "vbscript outlook signature" or similar).

Public Sub CreateNewOutlookMail

On Error Resume Next

Dim ol, newMail, olMailItem, file, path

olMailItem = 0
Set ol = CreateObject("Outlook.Application")

Set newMail = ol.CreateItem(olMailItem)

newMail.Subject = "Regarding " & ScriptValues.Item("DOCUMENT_TITLE").Value

newMail.Body = "This is the message body. You should replace it in the macro with something nicer." & vbCrLf

' Fix up slashes and backslashes

path = Replace(Replace(ClientScriptValues.Item("CHECK_OUT_PATH").Value, "/", "\"), "\\", "\")

' Add a backslash at the end of the path if it is not there

If Not Mid (path, Len (path)) = "\" Then
path = path & "\"
End If

file = path & "temp\" & ClientScriptValues.Item("LOCAL_FILE_1").Value

newMail.Attachments.Add (file)

newMail.Display

Set ol = Nothing

If Err.Number <> 0 Then
MsgBox "Got an error when trying to send the e-mail using Outlook. Error number: " & CStr(Err.Number) & " " & Err.Description & Err.Source
Err.Clear
End If

End Sub

Check out my recent post here on Community on how to write a basic macro and also my recent post on Workplace on how document macros work in general. The official documentation also explains the basic flow:

 https://docs.ifs.com/ifsclouddocs/22r2/CreateAndMaintainDocument/AboutDocumentMacro.htm?StandAlone=true

Good luck!

 

Userlevel 7
Badge +30

Here is how I set up the macro after creating the macro block SENDMAIL:

This macro needs to be defined for each file type you want to use it for. It’s a little work, but not much since you will reuse the macro block for each macro. It also does NOT need to be defined for each document class unless you are restricting certain macros for some classes.

 

Reply