Mailing questions, attach files, alter subject, German trans

delphi package - automated exception handling
Post Reply
MarkusD
Posts: 14
Joined: Wed Jan 04, 2017 9:32 am

Mailing questions, attach files, alter subject, German trans

Post by MarkusD »

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
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

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

Post by madshi »

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
MarkusD
Posts: 14
Joined: Wed Jan 04, 2017 9:32 am

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

Post by MarkusD »

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
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

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

Post by madshi »

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.
Post Reply