Some mail clients, such as Outlook and Thunderbird, appear to insert double spacing line breaks at every line. The reason is that those mail clients set the 'content-transfer-encoding' in MIME to 'quoted-printable' which adds Carriage Return Line Feed (CRLF) line breaks to the source content of the email which are characters interpreted by these mail clients. To alleviate this problem, please do the following:
Use the MIME layout in your email below when sending through SendGrid. It is best to reference files using separate links to download since it lowers the percentage of spam threshold for most domains you are sending to.
1email = SendGrid::Mail.new23email.from = SendGrid::Email.new(email: 'team@email.com')45email.subject = "App - Reset Password"67per = SendGrid::Personalization.new89per.to = SendGrid::Email.new(email: user.email, name: user.name)1011per.substitutions = SendGrid::Substitution.new(key: "user_name", value: user.name.split(" ")[0].capitalize)1213per.substitutions = SendGrid::Substitution.new(key: "reset_link", value: some_func(token, email: user.email))1415email.personalizations = per1617email.contents = Content.new(type: 'text/html', value: 'test')1819email.contents = SendGrid::Content.new(type: 'text/plain', value: "Hi #{user.name}.. Click the following link to reset your password.. #{function_reset(token, email: user.email)}... This link will expire in two hours.. If you did not request your password to be reset, please ignore this email and your password will stay as it is.")2021email.template_id = "6ede18bb-2eba-4958-8a57-43a58a559a0a"2223response = @@sg.client.mail._('send').post(request_body: email.to_json)2425puts response.status_code2627puts response.body2829puts response.headers