Uploaded image for project: 'Commons Email'
  1. Commons Email
  2. EMAIL-35

[email] Embedding raw DataSource Attachments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1
    • None
    • Operating System: All
      Platform: All

    • 36844

    Description

      I kick myself for not submitting this prior to 1.0. An important feature
      missing from org.apache.commons.mail.HtmlEmail is the ability to embed an
      arbitrary DataSource object. The current API only allows you to embed from a
      URL. My usage of CommonsEmail often includes the generation of image data
      on-the-fly, where it does not exist at a pre-defined URL.

      I propose the addition of a key method:

      public String embed(DataSource datasource, String name, String cid) throws
      EmailException

      This will allow us to attach our own datasources in addition to defining our own
      content-ids. Helper methods can be created to auto-generate CIDs when needed
      and allow for backwards compatability. I've found that being able to provide my
      own defined CIDs has been very helpful in referencing them in my velocity email
      templates.

      I will attach the current EnhancedHtmlEmail class that I have been using for a
      year or so. It extends HtmlEmail to provide the methods explained above. I
      would hope to have this capability introduced into the HtmlEmail class.

      Feel free to contact me to discuss further! Thanks.

      Attachments

        1. HtmlEmailTest.patch
          1 kB
          Ben Speakmon
        2. HtmlEmail.patch
          6 kB
          Ben Speakmon
        3. ASF.LICENSE.NOT.GRANTED--EnhancedHtmlEmail.java
          3 kB
          Brandon Wolfe

        Issue Links

          Activity

            People

              bens Ben Speakmon
              wolfeb@mitre.org Brandon Wolfe
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: