Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2133

Email: If html is provided, but no text version, convert from html

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0-b1
    • Fix Version/s: 4.0.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      Throughout the system we ask for HTML and Text versions for emails. Primarily through email templates, however, it is possible to send email directly to a client using the Email feature on their client profile page, and as of 4.0 via the Mass Mailer plugin.

      At least in the case of sending a direct email to a client, no text version has to be entered and an email can be sent with an HTML only version. In mail clients that choose not to render HTML, these would appear as blank emails.

      Instead, what we should do is automatically generate the text version if it does not exist at the time the message is sent. This would at minimum involve stripping tags and converting breaks to new lines. There may be some build in method to accomplish this already, but I'm not aware of it.

        Issue Links

          Activity

          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          No email currently needs either an HTML or Text version in order to be saved/sent.

          The UI will need to be updated to denote the behavior that HTML is converted to Text if not provided, and will need to be added to the documentation.

          • /admin/clients/email/
          • /admin/settings/company/emails/edittemplate/
          • add/edit module row on the Universal Module for email notifications

          Should this apply to email signatures? If so, the rule validating Text will need to be removed and the `email_signatures` table will need to be updated to allow for the text field to be null.

          Should this apply to the package welcome email? If so, the Text version needs to be generated at the time the package is saved. Otherwise, the service creation email template will reference a

          {package.email_text}

          tag in its Text version that could contain no information when sent.

          Show
          tyson Tyson Phillips (Inactive) added a comment - No email currently needs either an HTML or Text version in order to be saved/sent. The UI will need to be updated to denote the behavior that HTML is converted to Text if not provided, and will need to be added to the documentation. /admin/clients/email/ /admin/settings/company/emails/edittemplate/ add/edit module row on the Universal Module for email notifications Should this apply to email signatures? If so, the rule validating Text will need to be removed and the `email_signatures` table will need to be updated to allow for the text field to be null. Should this apply to the package welcome email? If so, the Text version needs to be generated at the time the package is saved. Otherwise, the service creation email template will reference a {package.email_text} tag in its Text version that could contain no information when sent.
          Hide
          admin Paul Phillips added a comment -

          What I was thinking for this task is that if a text version is not included when the email is sent, a text version would be created on the fly from the HTML version.

          For the UI for the mass mailer, we should have an option to "Specify Text Version", that would make the text version available. Otherwise, it would be converted automatically at the point in which the email is sent.

          However I don't think this should apply to Email Templates, Package Welcome, or Signatures. These are pre-defined and are not modified often. If we do it here, we will need to implement a method by which we remember whether we are converting from HTML on save, or using the supplied Text version. This complicates it too much.

          So, then, the only difference in the rest of the system in terms of email is that at the time the email is sent out if there is no text version supplied, create it on the fly. No UI changes.

          Show
          admin Paul Phillips added a comment - What I was thinking for this task is that if a text version is not included when the email is sent, a text version would be created on the fly from the HTML version. For the UI for the mass mailer, we should have an option to "Specify Text Version", that would make the text version available. Otherwise, it would be converted automatically at the point in which the email is sent. However I don't think this should apply to Email Templates, Package Welcome, or Signatures. These are pre-defined and are not modified often. If we do it here, we will need to implement a method by which we remember whether we are converting from HTML on save, or using the supplied Text version. This complicates it too much. So, then, the only difference in the rest of the system in terms of email is that at the time the email is sent out if there is no text version supplied, create it on the fly. No UI changes.
          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          This task describes HTML to Text conversion that you intend to apply to the Mass Mailer and to manual emails sent from the core, however, we cannot apply this behavior to any email when it is sent unless we apply it to them all since they are one and the same.

          We could pass along a flag when sending an email specifically from the mass mailer or when emailing a client from the core that will conditionally convert HTML to Text if Text is not provided.

          Show
          tyson Tyson Phillips (Inactive) added a comment - This task describes HTML to Text conversion that you intend to apply to the Mass Mailer and to manual emails sent from the core, however, we cannot apply this behavior to any email when it is sent unless we apply it to them all since they are one and the same. We could pass along a flag when sending an email specifically from the mass mailer or when emailing a client from the core that will conditionally convert HTML to Text if Text is not provided.
          Hide
          admin Paul Phillips added a comment -

          It should apply globally, but the HTML to Text conversion should occur on the fly at the time the email is sent. We are not converting to text and saving the text version anywhere, except perhaps as a result of mail logs. All existing templates in the system would continue to work as they do without conversion, because a text version is present. Unless users remove the text version, then it would be converted.

          So then, always convert from HTML when there is no text version - system wide. Just do it on the fly, and do not store the converted text version.

          Show
          admin Paul Phillips added a comment - It should apply globally, but the HTML to Text conversion should occur on the fly at the time the email is sent. We are not converting to text and saving the text version anywhere, except perhaps as a result of mail logs. All existing templates in the system would continue to work as they do without conversion, because a text version is present. Unless users remove the text version, then it would be converted. So then, always convert from HTML when there is no text version - system wide. Just do it on the fly, and do not store the converted text version.

            People

            • Assignee:
              tyson Tyson Phillips (Inactive)
              Reporter:
              admin Paul Phillips
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Sep/16