Dynamic templates support#449
Conversation
|
Any chance for a |
|
That's a good idea @nickneiman, thanks for contributing! If you don't have time to add that feature, no problem, just let me know and I'll open a separate issue for @nickneiman's request. |
|
@nickneiman @thinkingserious I'll add that feature today. |
|
I suspect that |
|
@pdtyreus thanks for the contribution, that's exactly what I was thinking! |
|
Updated PR to be possible include more complex types of dynamic template data. Before was only possible to generate a structure like: Now it's possible to generate something like: |
|
I was wondering if making
The idea here is to have interface less error prone when adding a dynamic template data, what do you guys think? |
|
@Markuus13 The idea of creating a safer interface is nice but you might actually end up limiting support for some possibly valuable scenarios. |
| @JsonProperty("dynamic_template_data") | ||
| public Map<String,Object> getDynamicTemplateData() { | ||
| if(dynamicTemplateData == null) | ||
| return Collections.<String,Object>emptyMap(); |
There was a problem hiding this comment.
Nitpick: It's generally safer to include curly brackets for all if statements. It can help protect against a future developer accidentally introducing a bug if another line is added to the if statement.
Alternatively, a more succinct way of writing this method would be:
return (dynamicTemplateData == null) ? Collections.<String, Object>emptyMap() : dynamicTemplateData;
There was a problem hiding this comment.
Thanks for the feedback @dgranahan!
I use curly brackets in if statements per default on my projects, but I didn't use here because I saw others methods on this class following this standard. I'll update the PR with this change. 👍
|
Any idea when this will be merged? |
|
Thanks for all the comments and votes everyone! They help move this issue up the queue in our backlog. I can't make any promises, but I'm looking to get this one out real soon. If anyone has time for a code review, that would be greatly appreciated and save a bit of time. With Best Regards, Elmer |
| dynamicTemplateData.put(key, value); | ||
| } else { | ||
| dynamicTemplateData.put(key, value); | ||
| } |
There was a problem hiding this comment.
Nitpick: you can save yourself a couple lines of code if you write this method like:
if (dynamicTemplateData == null) {
dynamicTemplateData = new HashMap<String,Object>();
}
dynamicTemplateData.put(key, value);
There was a problem hiding this comment.
Thanks for taking the time to review @dgranahan!
|
Good work on supporting this guys! Any idea on a timeframe on when it could be merged and then released? |
|
Hi @pacey! Thanks for the kind words! I can't give a firm timeframe, but I can say this is a high priority PR for us and should be merged soon. Your comment/vote helps increase the position in our backlog queue. With Best Regards, Elmer |
|
Any idea when this will be finished? 7 days with no activity does not bode well for those of us waiting for this to get merged. |
|
I've had trivial PRs waiting in this project for months, so I wouldn't hold your breath. Apply workarounds and move on... |
|
@Markuus13 would it be fine if I pushed minor readability updates to speed up the process and help @thinkingserious merge this faster according to Sendgrid's requirements? We are trying our best to merge this in no later than the end of this week and I'm trying to help out from within the SendGrid team. Please let me know if you would be fine with that and thank you for the amazing PR! |
|
HI @marshallpierce, @Octember, We just expanded our team today! We are committed to improving our developer experience at SendGrid and we greatly appreciate your past contributions and hope you will continue to collaborate with us. My apologies for the delays, they are my fault. We just released support for the PHP and Python SDKs, C# is next, followed by this SDK, so I'm hopeful this one will be released shortly. With Best Regards, Elmer |
|
Hello, first of all thanks a lot for the fix @Markuus13 , second when is this getting merged into the library?It is really urgent for me to get this feature ASAP @thinkingserious |
|
@suciuandrei94 just extend the Personalization class and copy the substitution code and change it to reflect the correct dynamic template json. It's very straightforward. I did so I could move on until this gets merged. @Markuus13 came here looking to make a PR and saw you already had it covered ;) @thinkingserious do you guys hire remote workers? I just left Denver. Almost applied for an internship there a while back but ended up getting something else. |
|
Hi @adam6806, Please send us an email to [email protected] to continue the conversation. Thanks! |
|
Can we have some updates for this PR ? Thanks ! |
|
@thinkingserious Any eta on when this will be merged? |
|
It seems like java will not have first class support from sendgrid. I am disappointed that we all basically have to build/extend this ourselves. Email should not be this difficult and we will begin to look at other providers that bother to support their paying customers. |
|
In my opinion this is getting ridiculous, being a developer myself this looks to me like 30 minutes fix. If it takes this long to do a simple fix, I wonder what will happen when something serious comes up. |
|
@samufort, @booi, @suciuandrei94, Thank you for taking the time to check in, I appreciate it! This SDK is next on the list to get updated with Dynamic Template helpers. I was hoping to have that done by now, but I could not get it done. Every day that goes by with this unreleased seriously disturbs me :( I hope you can accept my sincere apology, I know it's frustrating. Out of the 7 languages we support, Java, in particular, is very important to us. On another related note, our team is finally in the process of expanding and I'm excited beyond measure because I know this will allow us to support all of you much better. Thank you for your continued patience, your time is valuable to us! In the meantime, any other code reviews on this PR are very much appreciated and help make sure we get this release right the first time. If not, no worries, we'll still get it done ASAP. With Best Regards, Elmer |
|
@thinkingserious have you made any progress regarding merging this PR ? I would love to have that in official library without hacking or building my own version. |
|
FWIW, I'm using this simple custom subclass instead of |
|
Hello @Markuus13, |
|
This has been released as part of v4.3.0. Thanks to all for the patience and support! We should have another release fairly soon, you can subscribe here to be notified by email. |
|
Hello @thinkingserious, |
Fixes #447
Hello everyone, this is my first contribution! I'am really excited in fix any problem that I may have missed, although I believe everything is ok. 😃
Changes