3 Replies Latest reply on May 17, 2013 3:26 AM by Markus Kuenstler

    System.open_url removes spaces in email body

      Hi,

      I have the requirement to send reports via email.

      The reports are simple text tables built with terminal-table.

      I'm using System.open_url with the mailto protocoll to open an email-client like this:

       

      url = "mailto:me@work.de?subject=#{subject}&body=#{create_report_mail_body()}"

      System.open_url(url)

       

      Naturally the text-tables contain lots of spaces.

      open_url kills my table structure by removing all but one space in a sequence of spaces.

      So the tables look like:

      +----------------------------------+-------------------------------------------+

      | Project | Time |

      +----------------------------------+-------------------------------------------+

      | pro_xyz | 00h 01min |

      +----------------------------------+-------------------------------------------+

      instead of:

      +----------------------------------+-------------------------------------------+

      | Project                          | Time                                      |

      +----------------------------------+-------------------------------------------+

      | pro_xyz                          | 00h 01min                                 |

      +----------------------------------+-------------------------------------------+

       

      Any ideas how to resolve this?

       

      Thanks,

      markus