Where to set the default "to" email address

Created on 15 December 2022, about 2 years ago
Updated 12 June 2024, 7 months ago

On the module description page, the first screenshot shows how to set a default email address by selecting a value from the webform. (This appears to be from Drupal 7.) I cannot find this setting anywhere in the Drupal 8 version of the module.

I'm testing with a fresh install:
Drupal 9.4.9
Webform 6.1.3
Webform Email Reply 2.0.2

💬 Support request
Status

Closed: works as designed

Version

2.0

Component

Documentation

Created by

🇩🇪Germany markdc Hamburg

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands Martijn de Wit 🇳🇱 The Netherlands

    It seems that this is the Site e-mail adres in the 2.x version

    You can find this under /admin/config/system/site-information/ -> E-mail.

     $default_from_email = \Drupal::config('system.site')->get('mail');
    

    webform_email_reply/src/Form/WebformEmailReplyForm.php

  • Status changed to Active 7 months ago
  • 🇺🇸United States kurttrowbridge

    That's true for the From: value (who's sending the email), but I think the original request was about the To: value (who's receiving it)—and I actually just came looking for that this week as well. Ideally, I would think you'd be able to either enter a token that would fill in the value from the Webform submission, or you'd get to choose on a per-form basis which Email field from the form gets used.

  • 🇮🇳India arunkumark Coimbatore

    @KurtTrowbridge @markdc

    In Drupal 7, the webform module provided the option to select the From address field from the existing Webform. But now latest version(Webform Email Reply 2.x) the From address approach has been changed.

    By default, the current website email address will be added as From address. To address is always open for the user to enter. It same as Drupal 7.

    Drupal 7(Webform Email Reply 2.x):

    Drupal 8+(Webform Email Reply 2.x):

  • 🇺🇸United States kurttrowbridge

    Hello again—I created a merge request with a couple additions based on this issue (so I'm also switching it to a feature request and modifying the title):

    1. The Email field on the reply form now has support for tokens, so you can enter the token for an email field as the value.
    2. If a Webform has at least one Email field, it now has a third-party setting (see /admin/structure/webform/manage/{webform}/settings) where you can specify the default recipient field for replies sent for that form's submissions.
    3. If a default field is set, the Email field is disabled and automatically filled in with the default field's value, but the reply form has a new checkbox so that it be customized beyond the default. (As I write this up now, I'm starting to wonder if that's overkill; maybe the default value just gets filled in, but the field remains enabled for further editing, and there's no checkbox at all. Open to feedback on that.)

    I did what I think was a decent amount of testing—sending replies to both a hardcoded email address and a token, confirming nothing breaks when the Webform has no email fields, confirming nothing breaks when the submission didn't use the default field—but would appreciate additional reviews or feedback. Thanks!

  • 🇳🇱Netherlands Martijn de Wit 🇳🇱 The Netherlands

    Is there a dependency on a specific version of webform in this change?

  • 🇺🇸United States kurttrowbridge

    (After thinking on it over the weekend, I decided the checkbox I introduced to customize the email when a default was set was overly complex—I removed it, so the Email field just has a default value if the submission has a value for the selected field, and is empty otherwise.)

    re: #7, no, I don't think so—third-party settings are a Drupal core feature and (despite this being my first time having used them myself) have been around since D8. Nothing else in my MR requires any specific Webform functionality.

Production build 0.71.5 2024