Note: you can download a sample code for the desktop UX summit 2021 session here.
You may want to use EurekaLog's sending capabilities to send arbitrary data (such as feedback from users or support requests). You don't need to perform a full exception processing to do so.
Note: consider using a web-form HTML page to contact you for feedback and support requests. You can open URL to such page from within your application via ECore.ShellExec function (for example, you can have a "Help" / "Contact Us" menu item in your app). This is often a preferable option, because it allows you to use different/separate work-flows and back-ends for crash reports and communications with users.
If you still want to use EurekaLog to send feedback and/or support requests - you have to ensure that submission from users will not be confused with crash reports. You can do this by:
Option 1: use e-mailYou can use EurekaLog to send e-mail with user's text to the specified address. You can:
All these options are described in the How to send an e-mail article.
We recommend that you collect (in other words, have input controls for) user's name, user's e-mail, user's message. That way you will be able to contact user with your reply.
Note: Simple MAPI, MAPI, and Shell/mailto will use preconfigured user account and do not require you to collect name/e-mail.
Option 2: use bug/issue trackerYou can also use EurekaLog to post arbitrary data into your bug tracker.
Important: the common issue with bug tracker: it does not allow to use an arbitrary e-mail as the recipient. E.g. when user sends you a message to your bug tracker with EurekaLog - you will see it as if it is coming from your crash report reporter account. You will have no way to reply back. You have to collect user's e-mail and append it to the message, so you can manually send a reply back via e-mail. This is why it is usually not a good idea to use your bug tracker to handle support requests. There are exceptions, though. For example, FogBugz allows you to specify arbitrary correspondent in the sCustomerEmail field (filled by EurekaLog automatically). A combined bug and issue tracker may also allow to add 3rd party recipients. Please, refer to documentation for your bug tracker to learn more about its features.
Overall, you need to do these steps:
Steps 3 and 4 are described below. Mantis is used as example, but you can replace it with your selected bug tracker. The steps should remain the same.
A). Altering workflowFirst, you need to subclass the class for your bug tracker. For example:
uses
initialization // Register send class to be the first in the list
Once you have your class override set up - now you need to alter its .Search method. This method is used to determine if a new bug is being posted, or if it is a duplicate. Our goal is to post feedback as a "new bug" (always).
uses // Add override to change the workflow // Default values will indicate that currently sent "report" is a "new bug"
This code will block grouping reports for feedback messages, while will not change default workflow for usual crash/leak reports. We are using a custom flag for this. The idea is that flag will be missing (set to False) when a crash/leak report is being sent by EurekaLog. However, if we are sending a feedback message manually - we can set this flag to True. See code below.
You are free to modify other methods. For example, you may want to modify .Insert method to add tags for feedback messages or to include/exclude/alter some fields. A .CustomFields property may be used to add values for custom fields.
B). Sending the messageNow you can send the message itself. The idea is to take all EurekaLog settings as specified in options for your project, and then make minimal adjustments/customizations.
uses // 1: copy from EurekaLog's project options // 2: indicate that this is a feedback // this is an arbitrary "flag", // which can be checked by our other code (see above) True; 'Your feedback message'; // e.g. Memo1.Text 'Short caption (subject)'; // e.g. Edit1.Text // so it will unique identify this message // This will produce BugID like '00001234' // '0000' will prevent later crash reports to be grouped // (for example, user name and e-mail) 'usually this holds bug report text, ' + 'you can replace it with any content or an empty string'; 'steps to reproduce'; 'Feedback'; // this is just an example ESysInfo.GetVersionNumber; ESysInfo.GetVersionNumber; ESysInfo.GetComputerName; ESysInfo.GetOSBuild; ESysInfo.GetOSTypeStr; ESysInfo.GetPlatform; ESysInfo.GetUserEMail; // you can also ask user, e.g. Edit2.Text
// 8: attach files (if any)
Important Note: the code above assumes that your project already have a bug tracker configured (Mantis in the example above). If you are looking for a code to send issue/feedback completely from your code (without external dependencies) - you don't need Options.Assign(CurrentEurekaLogOptions); line, but you should add these instead:
// Replace with your selected bug tracker Options.SendClasses := wsmMantis; // wsmMantis is defined in ETypes,
// Code below is only an example, replace with your data
See also:
|