-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add the missing fields to the constructors PayloadGenerator... #345
Comments
Hi Alexandre, Im sorry but I'm not sure if I got you right... The part of your request about the "tag" is unclear to me. Can you explain it in different words or give some examples? |
I meant the following ... for example, the constructor
incorrect (there is no check for valid values) used MailEncoding.SMTP and (MailEncoding.MAILTO and MailEncoding.MATMSG witout body tag)
correct
maybe this is all a very specific approach - but nevertheless ps
|
Ok, I think I got what you mean. So you mean for the constructors where message won't be set, the ouput string shouldn't contain an empty body ( I wouldn't describe the actual behaviour as wrong, because passing an empty string as mail body is practically (for the end user) the same, then passing no body at all and in addition it's syntactically valid. But from a technical point of view, you're right. Passing an empty body makes the payload unnecessarly longer than it must be. So I'll improve/rewrite those payload generators next week, to supress unset body/subject fields. Regarding the second request - the attributes: I'll have a look into it, but aren't those meant to be used with fields/properties of (data model) classes? If we take the Mail-class for example (see here) - it has no public fields/properties, but all information is passed via the constructor. So, if validation work is done, it should take place in/at the constructor. Can we attach those attributes (Required, Range, ...) also to function parameters of the constructor? |
in my application,
then I analyzed the incoming data here it will probably be enough to attach attributes only to Properties, Parameters, Methods |
Hi Alexandre, I did not add any restriction/validation, because it's valid to pass an empty/null value for receiver/subject/message in any combination. (If all three are empty, the mailto-link should just open the default mail editor. If only a subject is set, the mail editor should compose a new mail with the given subject.) All of those combinations are valid and useful use cases. Thus I won't add any validation/restrictions. Regarding your request to add (custom) attributes: I have thought again about the topic and I won't add those attributes. There is no useful way by using the standard attributes, because nearly all payload generator classes have no public properties, but are set via their constructors. To fullfill your request, I had to add own/custom attributes that then could be parsed by you via reflection. I don't see that there's a general need or in other words: this is a very, very specific and niche use-case. Thus I won't add this feature. Sorry. |
Hi,
please add the "body" field to the constructors where it is used
by the
public class Mail: Payload
public class SMS: Payload
public class MMS : Payload
))
let's bring everything to one style!
if there is a tag in the qr string, then it should be described in the constructor
Thanks
The text was updated successfully, but these errors were encountered: