You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is now time to implement the final piece of our v2 to v3 migration. Before we dig into writing the code, we would love to get feedback on the proposed interface.
If you are tagged on this message, it means we are particularly interested in your feedback :)
If you don't have the time, no worries and my apologies for the disturbance.
If you do have the time, please take a look at the proposed helper upgrade above and let us know what you think. Any and all feedback is greatly appreciated.
Thanks for taking the time to take a look and provide some great feedback :)
I had not worked out those details yet, but the thinking behind putting everything behind objects is to make it possible to do things like you propose and to provide client side error checking.
Thank you @thinkingserious for your kind call, I appreciate that.
Well done guys!
There are just a couple of things that in my opinion would deserve some more attention:
Builders/helpers
Bloch suggests to avoid constructors having more than five parameters (items 1, 40). Personally my average cap (mainly depending on the class name, its context and the types of its parameters) is to have at most 2/3 parameters for a non-private constructor.
I would like to see a clever, unambiguous, loud-speaking, scalable builder (Bloch, item 2) for the following classes:
SendGridMessage
Attachment
And some helper class for encapsulating the parameters of the following methods in the SendGrid class:
setSubscriptionTracking
setGoogleAnalytics
Recipients
What's the reason for having To, Cc and Bcc classes in place of some general Recipient class?
Sandboxing
I did not see sandboxing mentioned in the linked document. Turning sandbox mode ON, and then removing it after successful check, currently is a pain (I remember an awful array read too). It would be nice to be able to rely on a single method invocation to set the sandbox mode flag.
I only had a chance to need to set the sandboxing parameters, but this will surely apply to other settings too. It would be nice to provide a general interface for setting all parameters.
I was brief and uncomplete in describing such points, but if it is needed I'll be available for discussing them further.
We really appreciate you taking the time to review and provide thoughtful feedback!
Following is my response to your feedback.
Builders/helpers
For SendGridMessage, the constructor includes the minimally required parameters for a successful call. I can limit the parameters of the constructor to those in the Send a Single Email to a Single Recipient example. I'll update accordingly. I'll also update the SubscriptionTracking and GoogleAnalytics objects to encapsulate the parameters.
Recipients
These will derive from a Recipients base class. It could be that they are all the same in the end, we are just future proofing.
SandBoxing
A demonstration of how to enable sandboxing is in the Kitchen Sink example: email.setSandBoxMode(true);
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!
Activity
[-] Helper Refactor - Call for Feedback[/-][+]Mail Helper Refactor - Call for Feedback[/+]thinkingserious commentedon Sep 17, 2017
@richardcsantana, @marcosbarbero, @TBuc, @jareddellitt, @rafalwrzeszcz, @stijndehaes, @bqcuong, @florian-f, @belfazt, @dmitraver, @dmaicher, @footloosejava, @josefeg, @ikatkov
If you are tagged on this message, it means we are particularly interested in your feedback :)
If you don't have the time, no worries and my apologies for the disturbance.
If you do have the time, please take a look at the proposed helper upgrade above and let us know what you think. Any and all feedback is greatly appreciated.
Thanks in advance!
diegoc-am commentedon Sep 18, 2017
Would these classes offer helper constructors?
so that only the email could be used?
If the name is not provided the email could be used as the name, or just pass
nullto the name arg like thisthinkingserious commentedon Sep 18, 2017
Hello @belfazt,
Thanks for taking the time to take a look and provide some great feedback :)
I had not worked out those details yet, but the thinking behind putting everything behind objects is to make it possible to do things like you propose and to provide client side error checking.
With Best Regards,
Elmer
TBuc commentedon Sep 18, 2017
Thank you @thinkingserious for your kind call, I appreciate that.
Well done guys!
There are just a couple of things that in my opinion would deserve some more attention:
Builders/helpers
Bloch suggests to avoid constructors having more than five parameters (items 1, 40). Personally my average cap (mainly depending on the class name, its context and the types of its parameters) is to have at most 2/3 parameters for a non-private constructor.
I would like to see a clever, unambiguous, loud-speaking, scalable builder (Bloch, item 2) for the following classes:
And some helper class for encapsulating the parameters of the following methods in the SendGrid class:
Recipients
What's the reason for having To, Cc and Bcc classes in place of some general Recipient class?
Sandboxing
I did not see sandboxing mentioned in the linked document. Turning sandbox mode ON, and then removing it after successful check, currently is a pain (I remember an awful array read too). It would be nice to be able to rely on a single method invocation to set the sandbox mode flag.
I only had a chance to need to set the sandboxing parameters, but this will surely apply to other settings too. It would be nice to provide a general interface for setting all parameters.
I was brief and uncomplete in describing such points, but if it is needed I'll be available for discussing them further.
thinkingserious commentedon Sep 20, 2017
Thanks @TBuc!
We really appreciate you taking the time to review and provide thoughtful feedback!
Following is my response to your feedback.
Builders/helpers
For
SendGridMessage, the constructor includes the minimally required parameters for a successful call. I can limit the parameters of the constructor to those in theSend a Single Email to a Single Recipientexample. I'll update accordingly. I'll also update the SubscriptionTracking and GoogleAnalytics objects to encapsulate the parameters.Recipients
These will derive from a Recipients base class. It could be that they are all the same in the end, we are just future proofing.
SandBoxing
A demonstration of how to enable sandboxing is in the Kitchen Sink example:
email.setSandBoxMode(true);With Best Regards,
Elmer
TBuc commentedon Sep 22, 2017
Great @thinkingserious !
Are you leaving out the Attachment class from the Builders/helpers refactoring for some specific reason?
thinkingserious commentedon Sep 23, 2017
No, that's a good catch @TBuc, I'll fix that.
thinkingserious commentedon Oct 1, 2017
Implementation will be tracked in this issue.
thinkingserious commentedon Mar 11, 2021
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!