fixing possible encoding error for sendgrid strategy (only for html and text parts)