sendgrid / sendgrid-ruby

The Official Twilio SendGrid Led, Community Driven Ruby API Library
https://sendgrid.com
MIT License
621 stars 324 forks source link

Not getting "text" parameter for some emails #443

Closed LetianChen closed 3 years ago

LetianChen commented 3 years ago

Issue Summary

I'm using inbound parse with my rails 6.0 app to handle customer support emails and I noticed that the "text" parameter is missing from some emails. At this moment all those emails came from the same account.

Here's the "html" parameter from the POST request:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style><![endif]--><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:inherit;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; font-size:11.0pt; font-family:"Calibri",sans-serif;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} pre {mso-style-priority:99; mso-style-link:"HTML \00D6nceden Bi\00E7imlendirilmi\015F Char"; margin:0cm; font-size:10.0pt; font-family:"Courier New";} span.HTMLncedenBiimlendirilmiChar {mso-style-name:"HTML \00D6nceden Bi\00E7imlendirilmi\015F Char"; mso-style-priority:99; mso-style-link:"HTML \00D6nceden Bi\00E7imlendirilmi\015F"; font-family:"Courier New";} .MsoChpDefault {mso-style-type:export-only;} @page WordSection1 {size:612.0pt 792.0pt; margin:70.85pt 70.85pt 70.85pt 70.85pt;} div.WordSection1 {page:WordSection1;} --></style></head><body lang=TR link=blue vlink="#954F72"><div class=WordSection1><div><div id=tw-smenu><p class=MsoNormal style='background:white'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#222222'><br><br><o:p></o:p></span></p></div><div style='margin-left:-12.0pt;margin-right:-12.0pt;text-align:initial;-webkit-box-flex: 1;flex: 1 1 0%;min-width: 0px;display:flex;flex-direction: column' id=tw-target><div id=kAz1tf><div id=tw-target-text-container><pre style='line-height:27.0pt'><span lang=EN style='font-size:12.0pt;font-family:"inherit",serif;color:#222222'>The prizes are 10 cents or more, I ask why I leave with 1 cent on every attempt, without any questions? otherwise, it's great that you pay 1 cent even though I didn't complete it. thank you.</span><span style='font-size:12.0pt;font-family:"inherit",serif;color:#222222'><o:p></o:p></span></pre></div></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Windows 10 için <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Posta</a> ile gönderildi</p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>Kimden: </b><a href="mailto:email-support@mycompany.com">email-support@mycompany.com</a><br><b>Gönderilme: </b>17 Ekim 2020 Cumartesi 23:19<br><b>Kime: </b><a href="mailto:theuser@gmail.com">theuser@gmail.com</a><br><b>Konu: </b>Issue with Survey 9974360</p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p>We have already credited your rewards 1 cents. We apologize for any inconvenience.<br>If you have any further problems, please don't hesitate to contact us.</p><p>Please continue to take more surveys and enjoy the rewards.</p><p>Kind regards,<br>The support team</p><p class=MsoNormal><img border=0 width=1 height=1 style='width:.0104in;height:.0104in' id="_x0000_i1025" src="https://u3282683.ct.sendgrid.net/wf/open?upn=KNeGEz9vQZuJE2DR8oY0Uz229aJjrcG3E7Ap5QphaOahhPfU19JJVBhBVvbv1EB8bP3ZK1pWhWoE2LEgWCJlWm1syyfdCjKn3k1nbrCZPJ3fsTwtE0YBn5X-2FgVRhQyWv4uVkX2mQy-2F5SXOCZfJi7-2FSu0QSteQiV7Te3PD8gnR2pLMEGc3YcCwV0lGhjI0l9Kx3LJTbVnBFEJ"></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>

Exception/Log

params["text"] is missing, making it hard to get email text content

Expected:

"text" is populated in the payload

eshanholtz commented 3 years ago

@LetianChen

Thanks for submitting a GitHub issue! We are very sorry that you are running into this problem. In order to better serve you, as this does not present itself as a library specific issue, we would like to ask that you reach out to our support team at support.sendgrid.com.

Thank you!