Skip to content
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

Template's subject line length #44

Open
vosi opened this issue Jan 7, 2016 · 8 comments
Open

Template's subject line length #44

vosi opened this issue Jan 7, 2016 · 8 comments

Comments

@vosi
Copy link
Contributor

vosi commented Jan 7, 2016

RFC doesn't really restrict the subject length and there is an issue while trying to use long Django template for subject with multiple if else

django.db.utils.DataError: value too long for type character varying(100)

I suggest using Text field

@vosi vosi mentioned this issue Jan 7, 2016
@gotlium
Copy link
Collaborator

gotlium commented Jan 7, 2016

I think we can use CharField with 350 length. But I think this is a big subject. And I do not see migrations for South. We are supporting Django from 1.4.

RFC 2822, section 2.1.1 to start. http://www.faqs.org/rfcs/rfc2822.html

There are two limits that this standard places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.

The recommendation for no more than 78 characters in the subject header sounds reasonable. No one wants to scroll to see the entire subject line, and something important might get cut off on the right.

@vosi
Copy link
Contributor Author

vosi commented Jan 7, 2016

I have a Django template in subject, with lots of if else
while the template length is abt 1000 chars - compiled length is no larger than 100

if you will limit it to 350 - then what is the point of having subject treated as the template?
All idea of this was to allow site's administrator to edit every bit of email template without getting deep to the code

as for RFC subj length - subj can be multiple lines
and there is no limit on resulting length
and you won't find mail server's default config that will limit the subject's length

@gotlium
Copy link
Collaborator

gotlium commented Jan 7, 2016

Ok. Please fix the problem with compatibility with old Django versions.
PS - can you show me real use cases for subjects with length > 100 ?)

@vosi
Copy link
Contributor Author

vosi commented Jan 7, 2016

will do today... in the evening
merry Christmas btw

@gotlium
Copy link
Collaborator

gotlium commented Jan 7, 2016

Thx, you too) And with New Year)

@vosi
Copy link
Contributor Author

vosi commented Jan 7, 2016

well I have a set of
Start text {{ obj.param1 }}, {% if obj.param2 %} ..... {% elif ....... {%if obj2.param1 .... etc

the result is much shorter, like
New job posted, Title, region or suburb or locality or remote, keywords or expire date ...

and for a/b testing and just for the ease of management it is much easier to have this editable in the admin panel, than via the source code

@gotlium
Copy link
Collaborator

gotlium commented Jan 7, 2016

Yes, you are right)

@kaleb
Copy link
Contributor

kaleb commented Feb 23, 2018

@vosi one thing I have done to get around this, even though it is not ideal since it is no longer editable in the database is that I have added {% include ... %} statements in the subject

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

No branches or pull requests

3 participants