Skip to content

Mail Helper Refactor - Call for Feedback #219

Closed

Description

@thinkingserious

Hello!

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.

Activity

  1. added
    status: help wanted
    type: community enhancement
    on Sep 17, 2017
  2. changed the title [-] Helper Refactor - Call for Feedback[/-] [+]Mail Helper Refactor - Call for Feedback[/+] on Sep 17, 2017
  3. thinkingserious commented on Sep 17, 2017

    @thinkingserious
    ContributorAuthor

    @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!

  4. diegoc-am commented on Sep 18, 2017

    @diegoc-am
    Contributor

    Would these classes offer helper constructors?

    From from = new From("test@example.com", "Example User");
    

    so that only the email could be used?

    From from = new From("test@example.com");
    

    If the name is not provided the email could be used as the name, or just pass null to the name arg like this

    assertTrue(new From("test@example.com").equals(new From("test@example.com", null)))
    
  5. thinkingserious commented on Sep 18, 2017

    @thinkingserious
    ContributorAuthor

    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

  6. TBuc commented on Sep 18, 2017

    @TBuc
    Contributor

    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.

  7. thinkingserious commented on Sep 20, 2017

    @thinkingserious
    ContributorAuthor

    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 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);

    With Best Regards,

    Elmer

  8. TBuc commented on Sep 22, 2017

    @TBuc
    Contributor

    Great @thinkingserious !

    Are you leaving out the Attachment class from the Builders/helpers refactoring for some specific reason?

  9. thinkingserious commented on Sep 23, 2017

    @thinkingserious
    ContributorAuthor

    No, that's a good catch @TBuc, I'll fix that.

  10. thinkingserious commented on Oct 1, 2017

    @thinkingserious
    ContributorAuthor

    Implementation will be tracked in this issue.

  11. removed
    difficulty: very hard
    difficulty: medium
    on Oct 27, 2017
  12. added
    type: twilio enhancement
    type: getting started
    and removed
    type: community enhancement
    on Feb 28, 2018
  13. thinkingserious commented on Mar 11, 2021

    @thinkingserious
    ContributorAuthor

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: very hardstatus: help wantedtype: getting startedtype: twilio enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions