Root > How to... > ...send a feedback/support request instead of bug report?

...send a feedback/support request instead of bug report?

Previous pageReturn to chapter overviewNext page   

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:

1. Creating two different "projects" in your bug tracker: one is for crash reports, another one is for users' feedback;
2. Creating a new "category" in your bug tracker for feedback;
3. Using a prefixes like [FEEDBACK], [SUPPORT], [CRASH], [LEAK] in your e-mails;
4. Using tags in your bug tracker is also an option, but it is not recommended (however, you can combine tags with a new project/category).

 

 

Option 1: use e-mail

You can use EurekaLog to send e-mail with user's text to the specified address. You can:

1. Use e-mail options as configured in EurekaLog options for your project;
2. Configure e-mail sending completely in your code;
3. Use e-mail options as configured in EurekaLog options for your project as base settings and modify them (for example, by adding prefix to subject, or changing/appending user's contacts).

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 tracker

You 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:

1. You have to configure your bug tracker in EurekaLog's options for your project. Be sure that you can send normal crash reports to your bug tracker;
2. [optional] It is highly recommended to have either separate "project" or "category" (dedicated to user's feedback) in the configuration of your bug tracker;
3. You have to disable the normal workflow for the bug tracker. In other words, you don't need grouping "same" feedback under a single ticket;
4. Finally, you need to send user's message from your code.

 

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 workflow

First, you need to subclass the class for your bug tracker. For example:

 

uses
  // Replace with unit for your bug tracker
  ESendAPIMantis;
 
type
  // Create your own class with the same name
  TELTrackerMantisSender = class(ESendAPIMantis.TELTrackerMantisSender)
  // ...

 

initialization

  // Register send class to be the first in the list
  RegisterSenderFirst(TELTrackerMantisSender);
end.

 

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
  ETypes,        // for TResponse
  ESendAPIMantis;// for TELTrackerMantisSender
 
type
  TELTrackerMantisSender = class(ESendAPIMantis.TELTrackerMantisSender)
  protected

    // Add override to change the workflow
    function Search: TResponse; override;
  end;
 
function TELTrackerMantisSender.Search: TResponse;
 
  function ThisIsAFeedback: Boolean;
  begin
    // This is just an example
    // See also code below
    Result := Options.CustomFieldBool['_my_feedback'];
  end;
 
begin
  if ThisIsAFeedback then
    // This is just a quick way to fill Result with defaults

    // Default values will indicate that currently sent "report" is a "new bug"
    CheckWinInetError(False, Result)
  else
    // Use default workflow for normal crash reports
    Result := inherited Search;
end;

 

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 message

Now 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
  EConsts,       // for sifXYZ constants
  EHash,         // for CRC16Hash
  EClasses,      // for TEurekaModuleOptions
  EModules,      // for CurrentEurekaLogOptions
  ESysInfo,      // for various GetXYZ functions
  ESend;         // for EurekaLogSend
 
procedure TForm1.ButtonFeedbackClick(Sender: TObject);
var
  Options: TEurekaModuleOptions;
  Files: TStringList;
begin
  Options := TEurekaModuleOptions.Create('');
  Files := TStringList.Create;
  try

    // 1: copy from EurekaLog's project options
    Options.Assign(CurrentEurekaLogOptions);
 

    // 2: indicate that this is a feedback

    // this is an arbitrary "flag", 

    // which can be checked by our other code (see above)
    Options.CustomFieldBool['_my_feedback']        := 

      True;

 
    // 3: store your feedback message from user
    Options.CustomField[sifBugText]                := 

      'Your feedback message'// e.g. Memo1.Text
    Options.CustomField[sifBugType]                := 

      'Short caption (subject)'// e.g. Edit1.Text
 
    // 4: you have to redefine BugID, 

    // so it will unique identify this message
    Options.CustomField[sifBugID]                  := 
      '0000' + IntToHex(CRC16Hash(UTF8Encode(
        Options.CustomField[sifBugType] + 
        Options.CustomField[sifBugText]
      )), 4);

    // This will produce BugID like '00001234'

    // '0000' will prevent later crash reports to be grouped
 
    // 5: (optional) add additional text, if needed 

    // (for example, user name and e-mail)
    Options.CustomField[sifMessage]                := 

      'usually this holds bug report text, ' +

      'you can replace it with any content or an empty string';
    Options.CustomField[sifStepsToReproduce]       := 

      'steps to reproduce';
 
    // 6: (optional) you may want to change caption/category/project/etc.
    Options.SendMantisCategory                     := 

      'Feedback'// this is just an example
 
    // 7: (optional) fill other informational fields
    Options.CustomField[sifBugAppVersion]          := 

      ESysInfo.GetVersionNumber;
    Options.CustomField[sifBuild]                  := 

      ESysInfo.GetVersionNumber;
    Options.CustomField[sifMachineID]              := 

      ESysInfo.GetComputerName;
    Options.CustomField[sifOSBuild]                := 

      ESysInfo.GetOSBuild;
    Options.CustomField[sifOSType]                 := 

      ESysInfo.GetOSTypeStr;
    Options.CustomField[sifPlatform]               := 

      ESysInfo.GetPlatform;
    Options.CustomField[sifUserEMail]              := 

      ESysInfo.GetUserEMail; // you can also ask user, e.g. Edit2.Text

 

    // 8: attach files (if any)
    Files.Add('C:\FileToSend1.txt');
    Files.Add('C:\FileToSend2.zip');
 
    // 9: actual send
    EurekaLogSend(Options, Files);
  finally
    FreeAndNil(Files);
    FreeAndNil(Options);
  end;
end;

 

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
    Options.SendMantisURL := 'example.com/mantis/'
    Options.SendMantisPort := 443;
    Options.SendMantisSSL := True;
 
    Options.SendMantisLogin := 'your-login';               
    Options.SendMantisPassword := 'your-password-or-token';
    Options.SendMantisProject := 'Test';               
    Options.SendMantisCategory := 'Feedback'
 
    Options.SendMantisCountFieldName := 'Occurencies';
    Options.SendMantisBugIDFieldName := 'BugID'
    Options.SendMantisEMailFieldName := 'Contact EMail'
 
    Options.SendMantisUseVersion := False;

 

 

See also:




Send feedback... Build date: 2024-09-30
Last edited: 2024-04-05
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/how_to_send_feedback.php