Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Send email

Hi

I want to send an email from a SuperOffice app using the default mail application, as if you create an email and using the webtools.

As an extra i want to add an attachment to the email.

How can i do this?

Kind regards
Michael

RE: Send email

Hi Michael,

Access to the email agent is restricted in the online environment and not available. Integrations must come up with their own means to send emails.

Von: Tony Yates 22. Jun 2021

RE: Send email

Thank's for the reply.
That explains why i can't seem to find anything about it.

Von: Michael Jensen 22. Jun 2021

RE: Send email

Hi Tony

It's probably just me who isn't smart enough, but why do you say we can't do that? In Infobridge Panels, it works just fine, and I see that right clicking a document gives me 'Send as e-mail' functionality, whereafter the document is attached my default email client through Webtools:

Opening email:

 

I assume we can do the same as Infobridge, right?

 

Regards

Søren Lyster

Von: Søren Lyster 22. Jun 2021

RE: Send email

Hi Søren (and Michael),

Ah, now see... that's something interesting that we haven't had much time to highlight and share information about. That specific functionality comes through our crossmessaging capability. 

Applications hosted in applications can only directly interact with SuperOffice via the browsers PostMessage API. We have a sample script on github called CrossMessaging that demonstrates how to invoke certain behaviors. Those behaviors are:

  1. Refresh the main browser window
  2. Navigation via an SoProtocol string
  3. Open document from a document id
  4. Invoke an ajax method

The "Send as email" function is make possible via #4, Invoking an ajax method. 

So where are these ajax methods anyway? Well, unfortunately there is no official documentation that consolidates all of the available methods. They are mainly discoverable by inspecting the browsers console output.

The only methods you can exploit are the ones that look like this:

 

Then select the line in the Network feed and on the right view the Request Payload (very bottom) to figure out what parameters the method accepts.

For example, to attach multiple documents to the Send As Email context menu command,  the parameter is a semi-colon delimited string:

SuperOffice.ClientCrossMessaging.ajaxMethod("SuperOffice.CRM.Web.AjaxMethods.Mail.GetSendDocumentsScript", "25;5");

I hope this helps!

Von: Tony Yates 23. Jun 2021

RE: Send email

Hi Tony

Thanks for the reply, and i am exited that you could guide me to do this.

The code snippet works just fine, and we are now able to send emails the way i was looking for.

Is it any way possible to add recipient(s) using this method?

SuperOffice.ClientCrossMessaging.ajaxMethod("SuperOffice.CRM.Web.AjaxMethods.Mail.GetSendDocumentsScript", documentId);

As i can't seem to find any documentation i have to ask.

Kind regards

Michael

Von: Michael Jensen 24. Jun 2021

RE: Send email

Hi Michael,

No. The documentation for that method only accepts one document id, or a delimited string of document ids. You must manually enter new email addresses in the dialog that appears.

Best regards.

Von: Tony Yates 24. Jun 2021

RE: Send email

Hi Tony

Thanks for the reply, and the link to the documentation.

Kind regards

Michael

 

Von: Michael Jensen 24. Jun 2021

RE: Send email

While it is true that the EMailAgent is restricted in Online environments, I'm not sure about the premise that integrations must come up with their own email solutions.

The EMailAgent is not the only restricted agent, and usually it's a matter of getting restricted features approved by SuperOffice at the time of app registration.

Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered.


While I assume it's not easy, and requires a large procedure to get access post-app-registation, it must be possible?
Possible and feasible is obviously not the same thing, but if it's possible then it can at least be considered.


Von: Jonas Degn 17. Aug 2021

RE: Send email

Hi Jonas, 

You can send a request with an explaination as to why your application should have access to that agent to appdev@superoffice.com.

Best regards.

Von: Tony Yates 17. Aug 2021