Sharing a bookmark by e-mail in SAP Lumira 2.x
Since Lumira 2.x this Bookmark sharing functionality has been deprecated. The e-mail functionality now allows you to create e-mails with any content that you want. You can now create e-mails with content other than just Bookmark URLs. The API call is:
You can pre-populate some of the e-mail data prior to sending it off to the local e-mail client.
Firstly remember that you can only share Bookmarks with a Global access type. Bookmarks with a Personal access type can only be viewed by the users that created them. You can simply get the URL of the relevant Bookmark and pass it to the new API. For example, you have listed all of your Bookmarks in a ListBox. The code snippet below shows how you might share a specific Bookmark in the ListBox after selecting it:
var bookmarkId = LISTBOX_1.getSelectedValue();
var url = BOOKMARK_1.getUrl(bookmarkId);
APPLICATION.sendEmail([“firstname.lastname@example.org”], “Sharing a bookmark via email”, url);
You can use the onClick event of a button, or some other element to trigger the above script. Once you call the script you will get your new e-mail created in your local e-mail client:
So now you can send e-mails to your colleagues containing a direct link to a given Global Bookmark.
If you wanted a popup prompt like the 1.6 behavior, you can construct one quite quickly using a Dialog component:
In the example above, you have a Dialog containing an Icon, an InputField and a Button. Then do the following:
- Add the following onClick to the Icon:
- Set the InputField property ‘editable’ to false
- Add the following onClick to the ‘Send by e-mail’ button:
APPLICATION.sendEmail(["email@example.com"], "Sharing a bookmark via email", INPUTFIELD_1.getValue());
Now you have a Dialog prompt to share Bookmarks by e-mail. However, the flexibility of the API in 2.x will allow application designers to use the e-mail functionality across the application and not just for Bookmarks.