You are viewing limited content. For full access, please sign in.

Question

Question

Send email from Laserfiche forms

asked on June 1, 2017

Dear all,

I will like to create a customised button on Forms that will open a new email for outlook and will pass on the email address from the email address field in the form to the new email screen.

 

The objective of this requirement to prevent the user going of LF forms, to open outlook etc... Hence, in a way to increase efficiency.

 

Your suggestions are most welcomed.

 

Regards,

Vimal

0 0

Replies

replied on June 1, 2017

Regarding your specific request, see the below example. It assumes that the form has two fields (Field1 is the email address and Field2 is the subject). Then you can add a custom HTML field with the following:

<button onclick="openEmailEditor()" type="button">Compose Email</button>
<script>
  function openEmailEditor() {
    var email = document.getElementById('Field1').value;
    var subject = document.getElementById('Field2').value;
    window.location.href = "mailto:" + email + "?subject=" + subject;
  }
</script>

If you just want the email address, then you can modify the code and remove the parts about the subject.

3 0
replied on April 22, 2019

FYI...we use Gmail instead of Outlook and initially, I kept getting a "Refused to display 'https://...[URL]' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'" error message.

Turns out Google will not open in an iframe, which is what the window.location.href = "mailto:" + email + "?subject=" + subject; property requires.

Instead, I used the window.open("mailto:" + email + "?subject=" + subject); method and the link now works for us without issue.

One more tip for Gmail users...you must set Gmail as your browser's default email client.  Here is a good article on how to do that.

0 0
replied on June 1, 2017 Show version history

Is there a specific reason why you'd need to switch from Forms to Outlook. The community in here is really creative and might be able to assist you with a better solution if you elaborate more on the project.

As of now, what I understand is that you want to avoid copy/paste an email address from Forms to Outlook, so you were thinking in a button to launch the Outlook screen with the email address in the To field already. Is that correct?

replied on June 1, 2017

Hi Raul,

 

You got it right...

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.