I am using the latest rc, 8.x-5.0-rc22.

Mail System settings

img

The Swift Mailer Settings

img

I also tried unchecking repect e-mail format.

Yet when I get the e-mail I get plain text:

<div style="font-family:Helvetica;font-size:16px;"> <p>Hello World</p>

It sounds like this was fixed in Swift Mailer no longer working after custom email handler theme option was added Did I miss something? or somehow everyone overlooked this...

The registration e-mails are theming & rendering HTML fine, so my issue has to be webform module related.

CommentFileSizeAuthor
#9 3005843-9.patch2.15 KBno sssweat
#6 3005843-6.patch2.12 KBjrockowitz

Comments

No Sssweat created an issue. See original summary.

no sssweat’s picture

Issue summary: View changes
jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

It is possible that your webform email handler still has a 'theme' property which needed to be changed to 'theme_name'

Can you remove all email addresses, export, and attach your webform here?

no sssweat’s picture

Thank you for looking into this Jacob, here is my export.

uuid: 029534db-1fbc-49b0-a6e3-f7ce5101e3fa
langcode: en
status: open
dependencies: {  }
open: null
close: null
weight: 0
uid: 12
template: false
archive: false
id: swift_mailer_email_test
title: 'Swift Mailer Email Test'
description: ''
category: ''
elements: |
  testing:
    '#type': textarea
    '#title': testing
css: ''
javascript: ''
settings:
  ajax: false
  ajax_scroll_top: form
  page: true
  page_submit_path: ''
  page_confirm_path: ''
  form_submit_once: false
  form_exception_message: ''
  form_open_message: ''
  form_close_message: ''
  form_previous_submissions: true
  form_confidential: false
  form_confidential_message: ''
  form_convert_anonymous: false
  form_prepopulate: false
  form_prepopulate_source_entity: false
  form_prepopulate_source_entity_required: false
  form_prepopulate_source_entity_type: ''
  form_reset: false
  form_disable_autocomplete: false
  form_novalidate: false
  form_disable_inline_errors: false
  form_required: false
  form_unsaved: false
  form_disable_back: false
  form_submit_back: false
  form_autofocus: false
  form_details_toggle: false
  form_access_denied: default
  form_access_denied_title: ''
  form_access_denied_message: ''
  form_access_denied_attributes: {  }
  form_file_limit: ''
  submission_label: ''
  submission_log: false
  submission_views: {  }
  submission_views_replace: {  }
  submission_user_columns: {  }
  submission_user_duplicate: false
  submission_access_denied: default
  submission_access_denied_title: ''
  submission_access_denied_message: ''
  submission_access_denied_attributes: {  }
  submission_exception_message: ''
  submission_locked_message: ''
  previous_submission_message: ''
  previous_submissions_message: ''
  autofill: false
  autofill_message: ''
  autofill_excluded_elements: {  }
  wizard_progress_bar: true
  wizard_progress_pages: false
  wizard_progress_percentage: false
  wizard_progress_link: false
  wizard_start_label: ''
  wizard_preview_link: false
  wizard_confirmation: true
  wizard_confirmation_label: ''
  wizard_track: ''
  preview: 0
  preview_label: ''
  preview_title: ''
  preview_message: ''
  preview_attributes: {  }
  preview_excluded_elements: {  }
  preview_exclude_empty: true
  preview_exclude_empty_checkbox: false
  draft: none
  draft_multiple: false
  draft_auto_save: false
  draft_saved_message: ''
  draft_loaded_message: ''
  confirmation_type: page
  confirmation_title: ''
  confirmation_message: ''
  confirmation_url: ''
  confirmation_attributes: {  }
  confirmation_back: true
  confirmation_back_label: ''
  confirmation_back_attributes: {  }
  confirmation_exclude_query: false
  confirmation_exclude_token: false
  limit_total: null
  limit_total_interval: null
  limit_total_message: ''
  limit_user: null
  limit_user_interval: null
  limit_user_message: ''
  entity_limit_total: null
  entity_limit_total_interval: null
  entity_limit_user: null
  entity_limit_user_interval: null
  purge: none
  purge_days: null
  results_disabled: false
  results_disabled_ignore: false
  token_update: false
access:
  create:
    roles:
      - anonymous
      - authenticated
    users: {  }
    permissions: {  }
  view_any:
    roles: {  }
    users: {  }
    permissions: {  }
  update_any:
    roles: {  }
    users: {  }
    permissions: {  }
  delete_any:
    roles: {  }
    users: {  }
    permissions: {  }
  purge_any:
    roles: {  }
    users: {  }
    permissions: {  }
  view_own:
    roles: {  }
    users: {  }
    permissions: {  }
  update_own:
    roles: {  }
    users: {  }
    permissions: {  }
  delete_own:
    roles: {  }
    users: {  }
    permissions: {  }
  administer:
    roles: {  }
    users: {  }
    permissions: {  }
  test:
    roles: {  }
    users: {  }
    permissions: {  }
handlers:
  email:
    id: email
    label: Email
    handler_id: email
    status: true
    conditions: {  }
    weight: 0
    settings:
      states:
        - completed
      to_mail: something@something.com
      to_options: {  }
      cc_mail: ''
      cc_options: {  }
      bcc_mail: ''
      bcc_options: {  }
      from_mail: _default
      from_options: {  }
      from_name: _default
      subject: _default
      body: |
        <div style="font-family:Helvetica;font-size:16px;">
        <p>Hello World</p>
        </div>
      excluded_elements:
        testing: testing
      ignore_access: false
      exclude_empty: true
      exclude_empty_checkbox: false
      html: true
      attachments: false
      twig: false
      debug: false
      reply_to: ''
      return_path: ''
      sender_mail: ''
      sender_name: ''
      theme_name: ''

I also tried changing the theme_name value from default to my theme name, but still same result.

Also, I have added images & text to my /theme/THEMENAME/templates/swiftmailer.html.twig and I see none of that. Looks to me that swiftmailer.html.twig is not getting called by webform.

Only local images are allowed.

no sssweat’s picture

Status: Postponed (maintainer needs more info) » Active
jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new2.12 KB

The issue is being triggered by the 'formatter' is set to SwiftMailer and the 'sender' is set Sparkpost.

The EmailWebformHandler is examing the sender and not the formatter when converting the message body to Markup. This is a bug which no one ran into because most people are using SwiftMailer as 'formatter' and 'sender'

no sssweat’s picture

I have downloaded the latest dev, placed the patch file in /webform root folder.

When I try git apply -v 3005843-6.patch

I get

Skipped patch 'src/Plugin/WebformHandler/EmailWebformHandler.php'.

and then checked EmailWebformHandler.php and patch has not been applied.

no sssweat’s picture

I guess I'll manually apply it and then generate a new patch if it works.

no sssweat’s picture

StatusFileSize
new2.15 KB

Thanks, these changes fixed the issue.

I have re-rolled the patch and tested it and it applies cleanly.

no sssweat’s picture

Component: Documentation » Code
Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: 3005843-9.patch, failed testing. View results

no sssweat’s picture

Category: Support request » Bug report

  • jrockowitz committed 5a43aa4 on 8.x-5.x authored by No Sssweat
    Issue #3005843 by No Sssweat, jrockowitz: Swift Mailer not rendering...
jrockowitz’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.