Afzal Masood
Afzal Masood

Reputation: 4551

Line-wrapping at the SMTP

I am sending html email and the SMTP server handling emails messages with hard-wrapping at proper length. I am using sendgrid and rails 3.2.11, need to do soft-wrapping in all lines of message below 1000 character. But I don't know how to do this!. How can we do soft-wrapping?

Upvotes: 1

Views: 543

Answers (1)

Swift
Swift

Reputation: 13188

You can use the ActionMailer format_paragraph helper to do soft-wrapping on your paragraphs. You can find the docs here:

http://rubydoc.info/docs/rails/ActionMailer/MailHelper:format_paragraph

Sample usage would be something like:

app/views/signup_mailer.html.erb

<%= format_paragraph("Some really really really really long text ...", 1000, 0) %>

Upvotes: 1

Related Questions