Not compatible with Resend functionality in Webform

Created on 8 February 2024, 5 months ago
Updated 5 March 2024, 4 months ago

Problem/Motivation

When using the "Resend" functionality in Webform, the provided "To email" address is ignored due to a overwrite in the "consultation_notify" handlers "sendMessage" function.

When debugging switching from SwiftMailer to SymfonyMailer I used the "Resend" feature in a Webform submission to resend previously submitted submissions so I could confirm the handlers were working.

However, no error would appear, but the email would never arrive.

After some debugging, it was found that in the handler, the sendMessage function overwrites the To field.

Normally this is used to replace the To field with whatever email address is specified in the Consultation nodes "field_cons_formal_subs_notify" field, however when none is provided, it default overwrites it to $consultation_settings->get('fallback_notify_email').

Meaning none of the test emails were coming through to as expected.

Steps to reproduce

- Install the Consultation module
- Setup a consultation with associated webform
- Provide a value in the "Formal Submission notify" field
- In the Consultation module configuration, provide an email in the "Default consultation notify email" field
- Add the "consultation_notify_handler" handler to the webforms submission
- Submit a consultation submission
- Note that the email will be send to the address provided in the "Formal Submission notify" field as expected
- In Webform submission, open the Resend tab (/admin/structure/webform/manage/*webform name*/submission/*submission id*/resend)
- Ensure the Consultation notify handler is selected, provide a different email address in the "To email" field
- Scroll down and click on "Resend message"

The resent email will be sent to the Default consultation notify email address, not the address provided in the resend form.

Proposed resolution

Add an additional check in the sendMessage function to determine if the trigger of the call is the Resend page, and then allow the use of the provided "To email" field.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia Toby Wild

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024