(877) 224-7768 <>
sales@profoundlogic.com <mailto:sales@profoundlogic.com>

iModernize - The Profound Logic Software Blog

Tips & Tricks: Automatically Open an E-mail Client in an Application

Posted by Rick Johnson on Nov 13, 2014 3:46:58 AM

Profound Logic Tips and TricksA common subfile column for customer or personnel data is an e-mail address. Using the ProfoundUI Rich Display, you can make the address a hyperlink that when clicked will open your e-mail client with the “send to” populated. In this example, we added a grid to the canvas for a simple three column subfile. First Name, Last Name and E-mail Address make up the data we’re going to display. emailopen

For the E-Mail Address column, we added a hyperlink widget. We bound the value” to a field called EMAIL. We also bound the property hyperlink reference” to a field as well called LINKREF. When the RPG program populates those fields, we would do the following:

EMAIL = 'rjohnson@profoundlogic.com'; (this is the text to display in the subfile)

LINKREF = 'mailto:rjohnson@profoundlogic.com'; (this is the hyperlink reference)

Note LINKREF uses the “mailto:” as the leading characters, followed by the e-mail address. When our program runs, you see the e-mail address is a hyperlink. When you click on the link, it opens the mail client with the address pre-populated.

emailopen2

You could set the LINKREF to include the subject and some message text as well: LINKREF = 'mailto:rjohnson@profoundlogic.com' + '?subject=Records Update&body=Your account has been updated';

emailopen3

You may also do this using an output field instead of a hyperlink in the subfile column. CSS classes may be use to style it anyway you like for display. To open the e-mail client, add code similar to this to the onclick” event of the EMAILTXT field. Use the getObj api to pull the value for the address. Then use pui.link to construct your mailto statement. You may even add a subject line.

When you click on the e-mail address your client results would look like this:

emailopen4

For more information on field binding, take advantage of this link:http://www.profoundlogic.com/docs/display/PUI/Field+Binding

And to learn more about the “onclick” event, follow this link: http://www.profoundlogic.com/docs/display/PUI/onclick+event

Topics: Tips and Tricks

Subscribe to Blog Updates

....and get our "How to Get Full Business Buy-In for Your Modernization Project" ebook!

business buy-in ebook

Recent Posts