Skip to content

Conversation

@XurdeFdez
Copy link

According with section Requirements and Limitations from http://sendgrid.com/docs/API_Reference/SMTP_API/ the JSON need to be splitted into lines under 1000 characters.
When ActionMailer detect white spaces wraps it automatically.

@chebyte
Copy link
Contributor

chebyte commented Sep 23, 2013

hi @XurdeFdez first, thanks for the pr, could you update the specs? cause travis is failing

by the way is not better to do something like this(is just a pseudo code)?

    if @data.length < 1000
      @data.to_json
    else
      JSON.generate(@data, {:indent => " ", :space => "", :space_before => "", :object_nl => "", :array_nl => ""})
    end

and question, the space goes in indent? cause it generates a json like this

 "{ \"to\":[  \"[email protected]\"]}"

thanks

@XurdeFdez
Copy link
Author

Hi @chebyte,
Now the specs are updated.
According to docs "Headers must be wrapped to keep the line length under 72", 1000 it's the hard limit in RFC 821.
The indetation is because "ActionMailer actually will handle folding and encoding the lines for you if you give it the proper spacing to do so"
Regards.

@DavidAllison
Copy link

@chebyte @XurdeFdez Any word on getting this merged? I didn't review the code but this is a useful feature since it's a requirement

@kylejginavan
Copy link
Member

I can merge if someone resolves the merge conflict.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants