Mailing questions, attach files, alter subject, German trans

delphi package - automated exception handling

Mailing questions, attach files, alter subject, German trans

Postby MarkusD » Wed Jan 04, 2017 12:15 pm

Hi,

1) How can I alter the subject of the mail, during *run time*? I do want to replace
"bug report"
to something like, if your application uses the German GUI
"Fehlerreport - %appname% - %appversion% - %date% - %time%"
or if it uses the English GUI:
"Error report - %appname% - %appversion% - %date% - %time%"

2) How can I affect the location/path of the "bugreport.txt" file? Saving it in the application folder is a very bad idea, because today no application has rights to write anything in that folder.

3) How do I attach files, when I don't know the folder name during compile time. Let's assume I want to attach a file:
"C:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\VCL\Windows 10 SharingContract\ProjectGroupSharingContract.groupproj"

4) Does anyone have translated German texts for "custom strings" section?

TIA, Markus
MarkusD
 
Posts: 9
Joined: Wed Jan 04, 2017 9:32 am

Re: Mailing questions, attach files, alter subject, German t

Postby madshi » Fri Jan 06, 2017 6:17 pm

Hi there,

unfortunately I don't have German texts ready to use for you (even though I'm German myself - ouch!). Shouldn't be too hard for you to translate them, though. It's a relatively short list of strings.

You can change most madExcept settings by changing properties of an IMESettings interface/object. You can either change the settings globally, by using the "MESettings()" function to get a global IMESettings instance. Or you can change them for just the "current" exception inside of a registered exception callback. In your case you probably want to change the settings globally, so you'd do something like this:

Code: Select all
uses ..., madExcept;

initialization
  with MESettings()
  begin
    MailSubject := 'whatever you like';
    BugReportFile := 'c:\bla\bugreport.txt';
    AdditionalAttachments.Add('c:\some file you want to attach', ...);
  end;
end.

See here for all the available IMESettings properties:

http://help.madshi.net/MESettings.htm
madshi
Site Admin
 
Posts: 9414
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mailing questions, attach files, alter subject, German t

Postby MarkusD » Mon Jan 09, 2017 11:42 am

madshi wrote:unfortunately I don't have German texts ready to use for you (even though I'm German myself - ouch!). Shouldn't be too hard for you to translate them, though. It's a relatively short list of strings.

I agree, the list of strings is not that long, but where exactly do I find these strings? They are in the .mes file, right? The .mes file looks like a INI-file, so far so good. But there is no pattern to detect which are the strings to translate. It would be much easier if there is one section with the strings to translate. That's why I asked if there is already a list of translated strings around, even a list in another language would be fine, just to find out what has to be translated.

Es würde wirklich sehr helfen, wenn es eine Liste gäbe mit Strings die zu übersetzen sind.

madshi wrote:You can change most madExcept settings by changing properties of an IMESettings interface/object. You can either change the settings globally, by using the "MESettings()" function to get a global IMESettings instance. Or you can change them for just the "current" exception inside of a registered exception callback. In your case you probably want to change the settings globally, so you'd do something like this:

Code: Select all
uses ..., madExcept;

initialization
  with MESettings()
  begin
    MailSubject := 'whatever you like';
    BugReportFile := 'c:\bla\bugreport.txt';
    AdditionalAttachments.Add('c:\some file you want to attach', ...);
  end;
end.

See here for all the available IMESettings properties:

http://help.madshi.net/MESettings.htm

Thanks for the link, there I found:
Code: Select all
// fieldName      : under which field name shall the file be sent?

To be honest, I still don't understand that, what is a "field" in relation to a Mail? Can you please present an example?

TIA, Markus
MarkusD
 
Posts: 9
Joined: Wed Jan 04, 2017 9:32 am

Re: Mailing questions, attach files, alter subject, German t

Postby madshi » Mon Jan 09, 2017 2:03 pm

All the settings are stored in the YourProject.mes file, but it's much easier to edit the settings by using the madExcept settings dialog in the IDE. If you open the settings dialog there's a section "custom strings" where all strings are listed that you can translate.

The "fieldName" is for HTTP upload, you can ignore that one.
madshi
Site Admin
 
Posts: 9414
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 4 guests

cron